Sub ll() Dim p1(0 To 2) As Double Dim p2 As Variant Dim pntobj As Variant
Dim lobj As AcadLine
p1(0) = 100 p1(1) = 100 p1(2) = 0
p2 = ThisDrawing.Utility.GetPoint(p1, "p2")
Set lobj = ThisDrawing.ModelSpace.AddLine(p1, p2)
End Sub
呵呵,没看清楚,上面那个是直线,这个才是多段线
Sub ll() Dim p1(0 To 2) As Double Dim p2 As Variant Dim pntobj As Variant
Dim lobj As AcadLWPolyline Dim vers(0 To 3) As Double
'p1(0) = 100 'p1(1) = 100 'p1(2) = 0
p2 = ThisDrawing.Utility.GetPoint(p1, "p2")
vers(0) = 100 vers(1) = 100 vers(2) = p2(0) vers(3) = p2(1)
Set lobj = ThisDrawing.ModelSpace.AddLightWeightPolyline(vers)
End Sub