Sub 差集()
' 定义长方体
Dim boxObj As Acad3DSolid
Dim cylinderObj As Acad3DSolid
Dim solidObj As Acad3DSolid
Dim length As Double
Dim width As Double
Dim height As Double
Dim center(0 To 2) As Double
center(0) = 5: center(1) = 5: center(2) = 0
length = 5
width = 7
height = 10
' 在模型空间中创建长方体对象
' 并着色为白色
Set boxObj = ThisDrawing.ModelSpace. _
AddBox(center, length, width, height)
boxObj.color = acWhite
' 定义圆柱体
'Dim cylinderObj As Acad3DSolid
Dim cylinderRadius As Double
Dim cylinderHeight As Double
center(0) = 0: center(1) = 0: center(2) = 0
cylinderRadius = 5
cylinderHeight = 20
' 创建圆柱体并
' 着色为青色
Set cylinderObj = ThisDrawing.ModelSpace.AddCylinder _
(center, cylinderRadius, cylinderHeight)
cylinderObj.color = acCyan
' 找出两个实体之间的干涉
' 并由干涉创建新的实体。新实体
' 着色为红色。
'Dim solidObj As Acad3DSolid
Set solidObj = boxObj.Boolean(acIntersection, cylinderObj)
solidObj.color = acRed
ZoomAll
End Sub
' 定义长方体
Dim boxObj As Acad3DSolid
Dim cylinderObj As Acad3DSolid
Dim solidObj As Acad3DSolid
Dim length As Double
Dim width As Double
Dim height As Double
Dim center(0 To 2) As Double
center(0) = 5: center(1) = 5: center(2) = 0
length = 5
width = 7
height = 10
' 在模型空间中创建长方体对象
' 并着色为白色
Set boxObj = ThisDrawing.ModelSpace. _
AddBox(center, length, width, height)
boxObj.color = acWhite
' 定义圆柱体
'Dim cylinderObj As Acad3DSolid
Dim cylinderRadius As Double
Dim cylinderHeight As Double
center(0) = 0: center(1) = 0: center(2) = 0
cylinderRadius = 5
cylinderHeight = 20
' 创建圆柱体并
' 着色为青色
Set cylinderObj = ThisDrawing.ModelSpace.AddCylinder _
(center, cylinderRadius, cylinderHeight)
cylinderObj.color = acCyan
' 找出两个实体之间的干涉
' 并由干涉创建新的实体。新实体
' 着色为红色。
'Dim solidObj As Acad3DSolid
Set solidObj = boxObj.Boolean(acIntersection, cylinderObj)
solidObj.color = acRed
ZoomAll
End Sub