Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vlax-curve-getdistatpoint

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
john.uhden
215 Views, 3 Replies

vlax-curve-getdistatpoint

Is there any reason this function would return 0 if the point provided is not at the start of an LWPolyline?

Maybe it's because I'm using 2002?

John F. Uhden

3 REPLIES 3
Message 2 of 4
CodeDing
in reply to: john.uhden

@john.uhden ,

 

No, there should be no reason. Are you encountering a scenario where it is? Provide insight if so


Need AutoLisp help? Try my custom GPT 'AutoLISP Ace':
https://chat.openai.com/g/g-Zt0xFNpOH-autolisp-ace
Message 3 of 4
Kent1Cooper
in reply to: john.uhden

It does that if you give it the start/end of a closed one, even if you request it for the end point:

(vlax-curve-getDistAtPoint pline (vlax-curve-getEndPoint pline))

returns zero [also for other closed shapes -- Circle, Ellipse, Spline].  But the Parameter approach to the same question does give the length of the Polyline [or other].

 

If you're not talking about the start/end point, is it just close enough to the start for display rounding to show zero?  Post a little drawing indicating where the Point in question is along the Polyline.

Kent Cooper, AIA
Message 4 of 4
john.uhden
in reply to: Kent1Cooper

@CodeDing & @Kent1Cooper ,

It was all my fault.

Before you ask for distatpoint, you have to get the closestpointto...

(defun @getdistatpoint (e p)
  (vlax-curve-getdistatpoint e
    (vlax-curve-getclosestpointto e p)
  )
)

The zero was my own mistake (embarrassing).

John F. Uhden

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta