創(chuàng)建一條輕量多義線并將第二段修改為圓弧。
Private Sub Command1_Click()
Dim plineobj As AcadLWPolyline
Dim points(0 To 9) As Double
points(0) = 1: points(1) = 1
points(2) = 1: points(3) = 2
points(4) = 2: points(5) = 2
points(6) = 3: points(7) = 2
points(8) = 4: points(9) = 4
Set plineobj = acadapp.ActiveDocument.ModelSpace.AddLightWeightPolyline(points)
plineobj.SetBulge 2, 1
plineobj.Update
ZoomExtents
End Sub
給輕量多義線添加新定點(diǎn),設(shè)置線寬,封閉多義線,計(jì)算多義線圍成的面積。
Private Sub Command1_Click()
Dim plineobj As AcadLWPolyline
Dim points(0 To 9) As Double
points(0) = 1: points(1) = 1
points(2) = 1: points(3) = 2
points(4) = 2: points(5) = 2
points(6) = 3: points(7) = 2
points(8) = 4: points(9) = 4
Set plineobj = acadapp.ActiveDocument.ModelSpace.AddLightWeightPolyline(points)
plineobj.SetBulge 2, 1
plineobj.Update
ZoomExtents
Dim newvertex(0 To 1) As Double
newvertex(0) = 4: newvertex(1) = 1
plineobj.AddVertex 5, newvertex
plineobj.SetWidth 4, 0.1, 0.5
plineobj.Closed = True
MsgBox "多義線圍成的面積=" & plineobj.Area
plineobj.Update
End Sub