各位高手:
我想利用三维多段线,通过拉伸一个圆环,在三维空间中生成管道,帮我看看程序哪里有问题,多谢了啊
Sub pipe() Dim circle1(0) As AcadEntity Dim circle2(0) As AcadEntity Dim regionObj1 As Variant Dim regionObj2 As Variant Dim point1(0 To 11) As Double Dim point2(0 To 2) As Double Dim radius1 As Double Dim radius2 As Double Dim line1 As Acad3DPolyline Dim solidObj As Acad3DSolid point1(0) = 0 point1(1) = 0 point1(2) = 0 point1(3) = 100 point1(4) = 0 point1(5) = 0 point1(6) = 100 point1(7) = 100 point1(8) = 0 point1(9) = 100 point1(10) = 100 point1(11) = 100 radius1 = 7 radius2 = 5 '创建面域 Set circle1(0) = ThisDrawing.ModelSpace.AddCircle(point1, radius1) Set circle2(0) = ThisDrawing.ModelSpace.AddCircle(point1, radius2) regionObj1 = ThisDrawing.ModelSpace.AddRegion(circle1) regionObj2 = ThisDrawing.ModelSpace.AddRegion(circle2) '布尔运算 regionObj1(0).Boolean acSubtraction, regionObj2(0) '拉伸路径 Set line1 = ThisDrawing.ModelSpace.Acad3DPolyline(point1) Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(regionObj1(0), line1)
End Sub |