Find segments of a lightweight polyline

Find segments of a lightweight polyline

mursix
Participant Participant
870 Views
3 Replies
Message 1 of 4

Find segments of a lightweight polyline

mursix
Participant
Participant

I want to select a lightweight polyline and determine which segment of the polyline was picked when selecting. Any ideas would be appreciated.

0 Likes
Accepted solutions (1)
871 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

@mursix wrote:

I want to select a lightweight polyline and determine which segment of the polyline was picked when selecting. Any ideas would be appreciated.


 

If by "which segment" you mean you want to know whether it was picked on the first one, or the second one, etc., with a number:

 

(vl-load-com); if needed
(defun C:PSN (/ plsel); = Polyline Segment Number (setq plsel (entsel "\nSelect LWPolyline: ")) (prompt (strcat "\nPolyline was selected on segment number " (itoa (1+ (fix (vlax-curve-getParamAtPoint (car plsel) (osnap (cadr plsel) "_nea") ) ) ) ) "." ) ) (princ) ) 

 

Kent Cooper, AIA
0 Likes
Message 3 of 4

mursix
Participant
Participant

Yes that will get me what I want. I am an old time lisp programmer and know very little about vla but figured there was a way.

 

Thank you very much!

0 Likes
Message 4 of 4

mursix
Participant
Participant

This worked great! Exactly what I wanted.

 

Thanks,

 

Kent

 

0 Likes