AcadLWPolylinej的节点数通过(.Coordinates+1)/2可确定其只有X,Y坐标. 以下程序的练习是读其数据后,再反过来做图.
Sub ls() Dim LWPl As AcadLWPolyline Dim pBugle() As Double With ThisDrawing Set LWPl = .HandleToObject("87") With LWPl p1 = .Coordinates ReDim pBugle((UBound(p1) + 1) / 2 - 1) For ii = 0 To UBound(pBugle) 'For jj = 0 To 2 pBugle(ii) = .GetBulge(ii) Next ii End With Set LWPl = .ModelSpace.AddLightWeightPolyline(p1) .Regen acActiveViewport For ii = 0 To UBound(pBugle) With LWPl .SetBulge ii, pBugle(ii) ThisDrawing.Regen acActiveViewport End With Next ii End With End Sub
|