3D實體_創建
Public Sub TestSlab() '平板體
Dim e As SmartSolidElement
Set e = SmartSolid.CreateSlab(Nothing, 10, 10, 10)
ActiveModelReference.AddElement e
End Sub
Public Sub TestSphere() '圓球體
Dim e As SmartSolidElement
Set e = SmartSolid.CreateSphere(Nothing, 10)
e.Transform Transform3dFromXYZ(20, 0, 0)
ActiveModelReference.AddElement e
End Sub
Public Sub TestCylinder() '圓柱體
Dim e As SmartSolidElement
Set e = SmartSolid.CreateCylinder(Nothing, 10, 20)
e.Transform Transform3dFromXYZ(40, 0, 0)
ActiveModelReference.AddElement e
End Sub
Public Sub TestCone() '圓錐體
Dim e As SmartSolidElement
Set e = SmartSolid.CreateCone(Nothing, 5, 10, 20)
e.Transform Transform3dFromXYZ(60, 0, 0)
ActiveModelReference.AddElement e
End Sub
Public Sub TestTous() '圓環體
Dim e As SmartSolidElement
Set e = SmartSolid.CreateTorus(Nothing, 10, 2, 300)
e.Transform Transform3dFromXYZ(80, 0, 0)
ActiveModelReference.AddElement e
End Sub
Public Sub TestWedge() '扇形體
Dim e As SmartSolidElement
Set e = SmartSolid.CreateWedge(Nothing, 10, 2, 45)
e.Transform Transform3dFromXYZ(95, 0, 0)
ActiveModelReference.AddElement e
End Sub
Public Sub TestWedge2() '扇形體2
Dim e As SmartSolidElement
Set e = SmartSolid.CreateWedge(Nothing, 10, 2, 270)
e.Transform Transform3dFromXYZ(120, 0, 0)
ActiveModelReference.AddElement e
End Sub
Sub 標示XYZ原點() '放置原點XYZ
Dim e As Element, pt(7) As Point3d
pt(0) = Point3dFromXY(0, 90): pt(1) = Point3dFromXY(-5, 90): pt(2) = Point3dFromXY(0, 100)
pt(4) = Point3dFromXY(0, 0)
pt(5) = Point3dFromXY(100, 0): pt(6) = Point3dFromXY(90, -5): pt(7) = Point3dFromXY(90, 0)
Set e = CreateLineElement1(Nothing, pt): e.Color = 5 '創建線串
ActiveModelReference.AddElement e
CommandState.StartDefaultCommand
End Sub
留言列表