多段线的起点从上一次绘图的终点开始。那么可以检索 LASTPOINT系统变量。
示例:
Dim moSpace As AcadModelSpace
Set moSpace = acadDoc.ModelSpace
Sub AddLightWeightPolyline()
Dim plineObj As AcadLWPolyline

‘ 返回上一次给图最后输入的点坐标
Dim pt as Variant
Pt=acadDoc.GetVariable(“LASTPOINT”)

Dim points(0 To 5) As Double

定义二维多段线的点
points(0) = pt(0): points(1) = pt(1)
points(2) = 4: points(3) = 2
points(4) = 6: points(5) = 4

在模型空间中创建一个优化多段线对象
Set plineObj = moSpace.AddLightWeightPolyline(points)
End Sub