Lee Mac 发表于 2022-7-6 14:35:15

Looping with Vlax-Curve-GetPoi

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

Lee Mac 发表于 2022-7-6 14:53:07

Has no-one else ever encountered this issue?

CAB 发表于 2022-7-6 14:55:50

Perhaps a test to prevent this incorrect distance?

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

( (if (

Lee Mac 发表于 2022-7-6 15:05:46

 
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.
 
 
I have modified a LISP posted on here ages ago by David Bethel to incorporate VLIDE colours and add the requiredtags to the code before posting

CAB 发表于 2022-7-6 15:15:34

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: ?

Lee Mac 发表于 2022-7-6 15:30:05

I could email the code to you if you wish?

CAB 发表于 2022-7-6 15:42:54

Yes, please do so.
Thanks
页: [1]
查看完整版本: Looping with Vlax-Curve-GetPoi