- 积分
- 156
- 明经币
- 个
- 注册时间
- 2022-2-24
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
Sub Example_AddExtrudedSolidAlongPath()
' This example extrudes a solid from a region
' along a path defined by a spline.
' The region is created from an arc and a line.
Dim curves(0 To 1) As AcadEntity
' Define the arc
Dim centerPoint(0 To 2) As Double
Dim radius As Double
Dim startAngle As Double
Dim endAngle As Double
centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
radius = 2#
startAngle = 0
endAngle = 3.141592
Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)
' Define the line
Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).startPoint, curves(0).endPoint)
' Create the region
Dim regionObj As Variant
regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
' Define the extrusion path (spline object)
Dim splineObj As AcadSpline
Dim startTan(0 To 2) As Double
Dim endTan(0 To 2) As Double
Dim fitPoints(0 To 8) As Double
Dim startPoint(0 To 2) As Double '定义起点坐标数组
Dim endPoint(0 To 2) As Double '定义终点坐标数组
startPoint(0) = 0#
startPoint(1) = 0#
startPoint(2) = 0#
'设置终点坐标
endPoint(0) = 10#
endPoint(1) = 10#
endPoint(2) = 0#
'创建直线对象
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
' Define the Spline Object
' Create the solid
Dim solidObj As Acad3DSolid
Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(regionObj(0), lineObj)
ZoomAll
End Sub |
|