geting the segment of the selected Pline
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
geting the segment of the selected Pline

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
juno
Guest





Posted: Fri Apr 08, 2005 6:30 pm    Post subject: geting the segment of the selected Pline Reply with quote

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

Back to top
Paul Richardson
Guest





Posted: Fri Apr 08, 2005 6:38 pm    Post subject: Re: geting the segment of the selected Pline Reply with quote

GetEntity method

"juno" <nospam@address.withheld> wrote in message
news:16089283.1112970663388.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
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
Back to top
Paul Richardson
Guest





Posted: Fri Apr 08, 2005 7:08 pm    Post subject: Re: geting the segment of the selected Pline Reply with quote

GetEntity method
"juno" <nospam@address.withheld> wrote in message
news:16089283.1112970663388.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
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


Back to top
David Urban
Guest





Posted: Fri Apr 08, 2005 8:12 pm    Post subject: Re: geting the segment of the selected Pline Reply with quote

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:
Quote:
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
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB