明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1156|回复: 0

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

[复制链接]
发表于 2006-5-27 08:42:00 | 显示全部楼层 |阅读模式

各位高手:

      我想利用三维多段线,通过拉伸一个圆环,在三维空间中生成管道,帮我看看程序哪里有问题,多谢了啊

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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 02:49 , Processed in 0.171572 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表