Author Topic: How to get the angle of the Picked vertex on multi-vertex polyline or Mline  (Read 7852 times)

0 Members and 1 Guest are viewing this topic.

jaydee

• Guest
Re: How to get the angle of the Picked vertex on multi-vertex polyline or Mline
« Reply #15 on: August 23, 2011, 08:31:44 PM »
Hi. Just a matter of interest and curiosity on LM Reply #6

What is the potetial usage of returning the angles between 2 Pline/Mline segment when user select a segment. and returning the angles.

Take the zigzag pline for example, depending on where the start point of pline is being drawn from L-R, R-L, T-B, B-T.

Because of the uncertain angles return base on visual on screen.
ie. if i select a vertex and expect the return angles of the selected vertex and the next vertex on the right/top.
but without knowingly the pline was drawn from L-R or T-B, then the return angle is not what the user expected.

Just curious in a situation like this, how can user utilise the return angles.

Thankyou

jaydee

• Guest
Re: How to get the angle of the Picked vertex on multi-vertex polyline or Mline
« Reply #16 on: August 24, 2011, 01:29:19 AM »
Quote
Wonder what the OP it is doing.... well just eating

I didn't ask for this. Something like this not going to be appriciated.

Lee Mac

• Seagull
• Posts: 12910
• London, England
Re: How to get the angle of the Picked vertex on multi-vertex polyline or Mline
« Reply #17 on: August 24, 2011, 05:15:43 AM »
Hi. Just a matter of interest and curiosity on LM Reply #6

What is the potetial usage of returning the angles between 2 Pline/Mline segment when user select a segment. and returning the angles.

I can't immediately think of use - I initially thought that was the result you were looking for and so put together an example to demonstrate one way to approach the problem.

Lee Mac

• Seagull
• Posts: 12910
• London, England
Re: How to get the angle of the Picked vertex on multi-vertex polyline or Mline
« Reply #18 on: August 24, 2011, 05:22:19 AM »
All here at theSwamp know about Lee's skills - He it is a master and apart likes to help without asking anything - no questions about it - Great guy indeed.

Now, me/and guess we, would like to see others putting more efforts, to show what the have done so far or what they can do, code skeletons, pseudo-code, ideas on how to solve things, etc...

TheSwamp have already a bunch of open-source code available to search and to put together - from simple routines to gems and why not to some day match Lee's code.

Many thanks Luis, I appreciate your kind comments - although, I'll be the first to say that there are definitely others here much more knowledgeable than I, (you, for example  ) I'm still learning a lot myself.

Although, by providing complete program examples, I'm probably not helping to encourage others to learn to write such programs for themselves. But I do enjoy writing the code and sometimes it is easier to explain a method using the code as an example.

CAB

• Global Moderator
• Seagull
• Posts: 10401
Re: How to get the angle of the Picked vertex on multi-vertex polyline or Mline
« Reply #19 on: August 24, 2011, 09:07:02 AM »
Hi. Just a matter of interest and curiosity on LM Reply #6

What is the potetial usage of returning the angles between 2 Pline/Mline segment when user select a segment. and returning the angles.

Take the zigzag pline for example, depending on where the start point of pline is being drawn from L-R, R-L, T-B, B-T.

Because of the uncertain angles return base on visual on screen.
ie. if i select a vertex and expect the return angles of the selected vertex and the next vertex on the right/top.
but without knowingly the pline was drawn from L-R or T-B, then the return angle is not what the user expected.

Just curious in a situation like this, how can user utilize the return angles.

Thankyou

Maybe if you want to bisect the angles between segments, but there are no way to guess the reasons for request
as evidenced by some of the posts this site.

FYI, Typically the multi segment pline directions are often referred to as clockwise or counter clockwise. CW or CCW

Code: [Select]
`----------  Remove a LWpolyline Vertex  --------http://www.theswamp.org/index.php?topic=19865.0http://www.theswamp.org/index.php?topic=5251.0http://www.theswamp.org/index.php?topic=10344------------  Remove  Bulge  ---------------http://www.theswamp.org/index.php?topic=34134.0  Tim Willey-----------  Add a  LWpolyline Vertex  ------------http://www.theswamp.org/index.php?topic=18720.0http://www.theswamp.org/index.php?topic=30170-----------  Polyline Reverse  -------------------http://www.theswamp.org/index.php?topic=12618.msg155016#msg155016  gilehttp://www.theswamp.org/Themes/oxygen11final/images/post/xx.gif Evgeniyhttp://www.theswamp.org/index.php?topic=32603.0  alanjthttp://www.theswamp.org/index.php?topic=1116.msg14511#msg14511 CAB 2004http://www.theswamp.org/index.php?topic=12618.msg198982#msg198982 CAB http://www.theswamp.org/index.php?topic=1116.msg14514#msg14514-----------  Point Inside Pline  -------------------http://www.theswamp.org/index.php?topic=7785.0http://groups.google.com/group/autodesk.autocad.customization/browse_thread/thread/6ec20cba1a1f9efe/79056df13e3f42b1?q=%40cv_inside+group:autodesk.autocad.customization#79056df13e3f42b1http://groups.google.com/group/autodesk.autocad.customization/attach/42682170bb9ac419/%40cv_inside.lsp?part=2`
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970

jaydee

• Guest
Re: How to get the angle of the Picked vertex on multi-vertex polyline or Mline
« Reply #20 on: August 24, 2011, 05:46:10 PM »
Look into the (vlax-curve-*) functions. (vlax-curve-paramatpoint will give you the segment the point is on (4.23 would mean the point is 23% along the 5th segment). SO from this you can get the PointAtParam for Params 3.0 (the 4th vertex) and 4.0 (the 5th vertex) and 5.0 (the 6th vertex). From those 3 points you can get the angle. The Params are 0 based with 0.0 usually being the startparam (Usually = almost always...Owen Wengard pointed out specific circumstances whereby programmers could alter this, but in my 20+ years working in Autocad I have yet to see it in my everyday use).

Thankyou Lee and CAB pointing me to thr right direction.
To be frank, sometime i dont even know where to start looking. As suggested by Jeff_M about vlax-curve functions that i never come across them before, therefor even if i see something like that in the seach, it still might not click. IOU heaps

CAB

• Global Moderator
• Seagull
• Posts: 10401
Re: How to get the angle of the Picked vertex on multi-vertex polyline or Mline
« Reply #21 on: August 25, 2011, 08:51:44 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970