- 积分
- 491
- 明经币
- 个
- 注册时间
- 2002-11-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
为何我在以下程序代码中,将剖切参数设为·ture或false画出的·图形没变化呢,知道这可能是个概念问题,请高手解释一下。
Public Sub BooleanResults()
'本过程演示实体间进行布尔操作的结果
ThisDrawing.SetVariable "ISOLINES", 20
Dim cylObj1 As Acad3DSolid
Dim cylCenter(0 To 2) As Double
Dim cylRadius As Double
Dim cylHeight As Double
cylCenter(0) = 0#: cylCenter(1) = 0#: cylCenter(2) = 0#
cylRadius = 100#
cylHeight = 500#
Set cylObj1 = ThisDrawing.ModelSpace.AddCylinder _
(cylCenter, cylRadius, cylHeight)
Dim cylObj2 As Acad3DSolid
cylCenter(0) = 0#: cylCenter(1) = 0#: cylCenter(2) = 0#
cylRadius = 125#
cylHeight = 500#
Set cylObj2 = ThisDrawing.ModelSpace.AddCylinder _
(cylCenter, cylRadius, cylHeight)'将2个柱体进行布尔运算
cylObj2.Boolean acSubtraction, cylObj1
ThisDrawing.Regen True
ThisDrawing.SendCommand "_hide" & vbCr
'声明组成剖切面的3个点数组变量
Dim slicePt1(0 To 2) As Double
Dim slicePt2(0 To 2) As Double
Dim slicePt3(0 To 2) As Double
'剖切面定义成YZ平面
slicePt1(0) = 0: slicePt1(1) = 75: slicePt1(2) = 0
slicePt2(0) = 0: slicePt2(1) = -75: slicePt2(2) = -100
slicePt3(0) = 0: slicePt3(1) = -75: slicePt3(2) = 100
'剖切经布尔运算以后的空心圆柱实体
Dim sliceObj As Acad3DSolid
Set sliceObj = cylObj2.SliceSolid(slicePt1, slicePt2, slicePt3, ture)
' sliceObj.Delete '保留剖切的Box实体
ThisDrawing.Regen True
End Sub |
|