Jump to content

Looping with Vlax-Curve-GetPointAtDist


Lee Mac

Recommended Posts

I seem to be having a problem with splines when using vlax-curve-GetPointAtDist, as it doesn't ever return nil when it has reached the end of the spline - it will just return a constant point which lies some way off the spline.

 

I wondered if anyone else suffered with this issue? And if they found a way to fix it?

 

My question is in reference to this thread:

 

http://www.cadtutor.net/forum/showthread.php?t=35741

 

 

I had to use a work-around which was far from ideal...

 

Cheers

 

Lee

Link to comment
Share on other sites

  • 3 weeks later...

Perhaps a test to prevent this incorrect distance?

(setq MaxDist (vlax-curve-getdistatparam curve-obj (vlax-curve-getendparam curve-obj)))

 

(<loop>
 (if (<= Dist MaxDist)
    (<do your thing>)

 

 

BTW how are you getting the color codeing in your posted code? :)

I seem to remember a post about that but my memory is going.:oops:

Link to comment
Share on other sites

Perhaps a test to prevent this incorrect distance?

(setq MaxDist (vlax-curve-getdistatparam curve-obj (vlax-curve-getendparam curve-obj)))

(<loop>
 (if (<= Dist MaxDist)
    (<do your thing>)

 

Thanks CAB, I resorted to a test similar to this in fact - but I just wondered why the function would throw up such an error, and keep the loop. - But I suppose its just the stubbornness of Splines.

 

BTW how are you getting the color codeing in your posted code? :)

I seem to remember a post about that but my memory is going.:oops:

 

I have modified a LISP posted on here ages ago by David Bethel to incorporate VLIDE colours and add the required tags to the code before posting :)

Link to comment
Share on other sites

Yes I have experienced the same problem but don't remember which routine I it was that needed corrective code. It would take some research to dig it up so I posted what I remembered as the fix.

 

That too is how I remember it but I can't find the COLOR lisp by David. I'm sure I would have saved it. What is the defun c: ?:unsure:

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