Looking for a way to find these points of an arc within a 2d polyline

Looking for a way to find these points of an arc within a 2d polyline

Anonymous
Not applicable
1,174 Views
2 Replies
Message 1 of 3

Looking for a way to find these points of an arc within a 2d polyline

Anonymous
Not applicable

I need help finding a way to retrieve these points of an arc within a 2d polyline using VBA. Any help or suggestions would be greatly appreciated.

 

PlineVertex.JPG

 

0 Likes
1,175 Views
2 Replies
Replies (2)
Message 2 of 3

MakCADD
Advocate
Advocate

extract the points of the segments of line

that is if bulge is 0 ----pline.getbulge(segmentIndex)=0

then create lines from these segments 

and find intersection points  line1.intersectwith(line2,acextendboth)

then delete these temporary lines

0 Likes
Message 3 of 3

MakCADD
Advocate
Advocate

Sub IP_Points()
Dim Pline As AcadLWPolyline
Dim Blge
Dim Lin() As AcadLine
Dim stpt(0 To 2) As Double
Dim enPt(0 To 2) As Double
Dim pT1
Dim pT2

Dim P As Integer
P = 0

Set Pline = ThisDrawing.ModelSpace.Item(0)

'Find straight line segments-----------
For I = 0 To ((UBound(Pline.Coordinates) - 1) / 2) - 1
Blge = Pline.GetBulge(I)

If Blge = 0 Then
ReDim Preserve Lin(P) As AcadLine

pT1 = Pline.Coordinate(I)
pT2 = Pline.Coordinate(I + 1)

For J = 0 To 1
stpt(J) = pT1(J)
enPt(J) = pT2(J)
Next J

stpt(2) = Pline.Elevation
enPt(2) = Pline.Elevation
Set Lin(P) = ThisDrawing.ModelSpace.AddLine(stpt, enPt)
P = P + 1
End If

Next '-------------------------------------------------

'Find Point of Intersection
Dim IntPt
For l = 0 To UBound(Lin) - 1
IntPt = Lin(l).IntersectWith(Lin(l + 1), acExtendBoth)
ThisDrawing.ModelSpace.AddCircle IntPt, 1
Next l

'Delete temporary lines
For l = 0 To UBound(Lin)
Lin(l).Delete
Next l

End Sub

0 Likes