Jump to content

Hello, it is possible to touch any point of a POLY and capture the coordinates of the 2 points of that segment of the POLY❓❓


duke

Recommended Posts

Hello again friends ‼‼
I have a doubt if it is possible to touch a POLY and somehow capture the coordinates of the 2 vertices that make up the segment where I touched the POLY. I don't know if I explain myself. I am attaching an image for greater understanding.
And thank you very much in advance ‼‼‼‼‼👌👌

aaaaaaaaaaaaaaaaaa copia.jpg

Link to comment
Share on other sites

Yes, it's possible:

 

(defun c:foo ( / pl pm)
    (and
        (setq pl (entsel "\nSelect polyline <exit>: "))
        (progn
            (setq pm (vlax-curve-getParamAtPoint (car pl) (vlax-curve-getClosestPointTo (car pl) (trans (cadr pl) 1 0))))
            (princ
                (list
                    (vlax-curve-getpointatparam (car pl) (fix pm))
                    (vlax-curve-getpointatparam (car pl) (1+ (fix pm)))
                )
            )
        )
    )
    (princ)
)

 

  • Like 2
Link to comment
Share on other sites

1 hour ago, Jonathan Handojo said:

Yes, it's possible:

 

(defun c:foo ( / pl pm)
    (and
        (setq pl (entsel "\nSelect polyline <exit>: "))
        (progn
            (setq pm (vlax-curve-getParamAtPoint (car pl) (vlax-curve-getClosestPointTo (car pl) (trans (cadr pl) 1 0))))
            (princ
                (list
                    (vlax-curve-getpointatparam (car pl) (fix pm))
                    (vlax-curve-getpointatparam (car pl) (1+ (fix pm)))
                )
            )
        )
    )
    (princ)
)

 

Bro,, you save meeeee ‼‼‼‼‼
THANKS ‼‼‼‼‼👌👌👌👌👌👌👌

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...