

with point at relative X coordinate incremented for dx You remove both helper XLINES and repeat from step 2. You find intersection point(s) of XLINE from step 4. You construct XLINE from intersection point(s) you found in step 3. You find intersection point of XLINE and flattened curve (there may be more than 1)Ĥ. You construct XLINE with point at relative X coordinate 0.0 and with direction (0.0 1.0 0.0) - X coordinate must be smallest one - so suggested method of finding this point is by using (vlax-curve-getclosestpointtoprojection curve '(-1e+99 -1e+99 0.0) '(0.0 1.0 0.0))ģ.
Xline helper 2d code#
Maybe one that is not so slow but the code should be bigger :Ģ. I agree with lrm for what he stated, but then again, I don't know what method to suggest you that is fast enough and that covers those issues lrm mentioned.

(write-line (strcat (rtos xe 2 nd) delim (rtos (cadr pe) 2 nd) delim (rtos (caddr pe) 2 nd)) fil) (write-line (strcat (rtos x0 2 nd) delim (rtos (cadr p) 2 nd) delim (rtos (caddr p) 2 nd)) fil)Ī (vlax-curve-getDistAtPoint curve-Obj p) P (vlax-curve-getPointAtDist curve-Obj c) (write-line (strcat (rtos xs 2 nd) delim (rtos (cadr ps) 2 nd) delim (rtos (caddr ps) 2 nd)) fil) Lc (vlax-curve-getdistatparam curve-Obj (vlax-curve-getendparam curve-Obj)) (defun c:fx( / a b c curve-obj delim dx ent eps fil lc name_file nd p pe ps x x0 xe xs )įil (open (strcat (getvar "DWGPREFIX") name_file) "w") I am waiting for a point of view from you. Here's my code, where I used the bisection method. Use the vlax-curve-getpointatdist or vlax-curve-getpointatparam function, supplied with your entity name and a given distance or parameter value.
