Solidlərin toplanması.
SphObj.Boolean acUnion, ConObj
Extrud və revolve komandaları birlikdə
Sub CreateMurekkeb ( )
Dim tap As Double
tap = 0.1 ‘ Yığılma bucağı
Dim height As Double
height = 100#
Dim aa As Acad3DSolid
Dim curves(0 To 0) As AcadCircle
Dim center(0 To 2) As Double, radius As Double
center(0) = 2: center(1) = 2: center(2) = 0: radius = 50#
Set curves(0) = ThisDrawing.ModelSpace.AddCircle(center, radius)
Dim regionObj As Variant
Dim rev As Acad3DSolid
Dim reg As AcadRegion
regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
Set reg = regionObj(0)
Set aa = ThisDrawing.ModelSpace.AddExtrudedSolid(reg, height, tap)
Dim p1(0 To 2) As Double
Dim p2(0 To 2) As Double
Dim an As Double
p1(0) = 150: p1(1) = 0: p1(2) = 0
p2(0) = 0: p2(1) = 150: p2(2) = 0 ` koordinat başlanğıcına görə istiqaməti müəyyən edir.
TamBucaq = 3.14159265* 2#
Set rev = ThisDrawing.ModelSpace.AddRevolvedSolid(reg, p1, p2, TamBucaq)
reg.Delete
curves(0).Delete
Dim NewDirection(0 To 2) As Double
NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
ThisDrawing.ActiveViewport.Direction = NewDirection
ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
ZoomAll
End Sub
Dostları ilə paylaş: |