VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

geting the segment of the selected Pline

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
163 Views, 3 Replies

geting the segment of the selected Pline

Is their a way I can select a polyline and get it’s: selection point, the entity and the polyline segment that was selected (providing that the Pline has more then one segment?)

Thank you in advance for the help,

-J
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

GetEntity method "juno" wrote in message news:16089283.1112970663388.JavaMail.jive@jiveforum2.autodesk.com... > Is their a way I can select a polyline and get it's: selection point, the > entity and the polyline segment that was selected (providing that the > Pline has more then one segment?) > > Thank you in advance for the help, > > -J
Message 3 of 4
Anonymous
in reply to: Anonymous

GetEntity method "juno" wrote in message news:16089283.1112970663388.JavaMail.jive@jiveforum2.autodesk.com... > Is their a way I can select a polyline and get it's: selection point, the > entity and the polyline segment that was selected (providing that the > Pline has more then one segment?) > > Thank you in advance for the help, > > -J
Message 4 of 4
Anonymous
in reply to: Anonymous

J You will need to get the entity and then use the explode funtion to expolde the pline to an array of entities. This will not disturb the orginal entity. then cycle through the exploded enties and go through some logic of finding which entitiy you have selected. here is a code snipit that I did. I was looking for only the curves. this is in LDD so it may be alittle foreign to some. it is not complete code so don't try and run it on its own. Dim explodeOBJ As Variant, pLine As AcadLWPolyline pUtil.GetSubEntity Object, PickedPoint, TransMatrix, ContextData, vbCrLf & "Pick CURB return at the intersection: " If TypeName(Object) = "IAcadLWPolyline" Then Set pLine = Object Err.clear: On Error Resume Next explodeOBJ = pLine.Explode alg.StationOffset PickedPoint(0), PickedPoint(1), pstation, offset, pdirection On Error GoTo 0 For i = 0 To UBound(explodeOBJ, 1) If TypeName(explodeOBJ(i)) = "IAcadArc" Then Set getcurve = explodeOBJ(i) Err.clear: On Error Resume Next alg.StationOffset getcurve.startPoint(0), getcurve.startPoint(1), Station, offset, direction alg.StationOffset getcurve.endPoint(0), getcurve.endPoint(1), station2, Offset2, Direction2 If (pstation < Station And pstation > station2 Or pstation < station2 And pstation > Station) _ And (poffset < offset And poffset > Offset2 Or poffset < Offset2 And poffset > offset) And Abs(offset - Offset2) < 75 Then found = True: Exit For End If End If Next i David Urban juno wrote: > Is their a way I can select a polyline and get it’s: selection point, the entity and the polyline segment that was selected (providing that the Pline has more then one segment?) > > Thank you in advance for the help, > > -J

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost