singlegu 发表于 2006-5-27 08:42:00

高手们,进来看看啊,你们举手就能解决的问题

<P>各位高手:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 我想利用三维多段线,通过拉伸一个圆环,在三维空间中生成管道,帮我看看程序哪里有问题,多谢了啊</P>
<P>Sub pipe()<BR>&nbsp;&nbsp; Dim circle1(0) As AcadEntity<BR>&nbsp;&nbsp; Dim circle2(0) As AcadEntity<BR>&nbsp;&nbsp; Dim regionObj1 As Variant<BR>&nbsp;&nbsp; Dim regionObj2 As Variant<BR>&nbsp;&nbsp; Dim point1(0 To 11) As Double<BR>&nbsp;&nbsp; Dim point2(0 To 2) As Double<BR>&nbsp;&nbsp; Dim radius1 As Double<BR>&nbsp;&nbsp; Dim radius2 As Double<BR>&nbsp;&nbsp; Dim line1 As Acad3DPolyline<BR>&nbsp;&nbsp; Dim solidObj As Acad3DSolid<BR>&nbsp;&nbsp; point1(0) = 0<BR>&nbsp;&nbsp; point1(1) = 0<BR>&nbsp;&nbsp; point1(2) = 0<BR>&nbsp;&nbsp; point1(3) = 100<BR>&nbsp;&nbsp; point1(4) = 0<BR>&nbsp;&nbsp; point1(5) = 0<BR>&nbsp;&nbsp; point1(6) = 100<BR>&nbsp;&nbsp; point1(7) = 100<BR>&nbsp;&nbsp; point1(8) = 0<BR>&nbsp;&nbsp; point1(9) = 100<BR>&nbsp;&nbsp; point1(10) = 100<BR>&nbsp;&nbsp; point1(11) = 100<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; radius1 = 7<BR>&nbsp;&nbsp; radius2 = 5<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; '创建面域<BR>&nbsp;&nbsp; Set circle1(0) = ThisDrawing.ModelSpace.AddCircle(point1, radius1)<BR>&nbsp;&nbsp; Set circle2(0) = ThisDrawing.ModelSpace.AddCircle(point1, radius2)<BR>&nbsp;&nbsp; regionObj1 = ThisDrawing.ModelSpace.AddRegion(circle1)<BR>&nbsp;&nbsp; regionObj2 = ThisDrawing.ModelSpace.AddRegion(circle2)<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; '布尔运算<BR>&nbsp;&nbsp; regionObj1(0).Boolean acSubtraction, regionObj2(0)<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; '拉伸路径<BR>&nbsp;&nbsp; Set line1 = ThisDrawing.ModelSpace.Acad3DPolyline(point1)<BR>&nbsp;&nbsp; Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(regionObj1(0), line1)</P>
<P>End Sub</P>
页: [1]
查看完整版本: 高手们,进来看看啊,你们举手就能解决的问题