Jump to content

How to select a spline from model space, and get coordinates of two endpoints


Recommended Posts

Posted

How to select a spline from model space, and get coordinates of two endpoints using Autolisp? Thanks a lot

 

Waiting online

Posted

Look into the use of vlax-curve-getStartPoint and vlax-curve-getEndPoint

Posted

Insert the code below into your routine:

 

(setq SplineEntity (ssget "_:S" '((0 . "SPLINE"))))            ;select spline entity (filter out other)
(if (= (sslength SplineEntity) 1)                              ;test if valid user selection
(progn
 (setq SplineEntity (ssname SplineEntity 0)
       SplineEntVLA (vlax-ename->vla-object SplineEntity))    ;convert spline to VLA object

 (setq SplineEnd1st (vlax-curve-getStartPoint SplineEntity)   ;list spline's endpoints
       SplineEnd2nd (vlax-curve-getEndPoint   SplineEntity))
)
)

 

Regards,

Posted

msasu, just so you know, you don't have to feed vla-objects to the vlax-curve-* functions; it will accept enames.

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...