VisDak Posted September 23, 2019 Posted September 23, 2019 Good day, I'm searching for a program that will divide and it will break or split intersecting hte points the line or polyline. this will used to capture coordinates points on an arc area to make it easy to get X and Y point for an arc Thanks for Help Quote
dlanorh Posted September 23, 2019 Posted September 23, 2019 (edited) 2 hours ago, VisDak said: Good day, I'm searching for a program that will divide and it will break or split intersecting hte points the line or polyline. this will used to capture coordinates points on an arc area to make it easy to get X and Y point for an arc Thanks for Help Obtaining coordinates of points on a line, polyline or arc is possible without dividing or breaking any of the objects using vlax-curve functions and a supplied number of points. Try this. You will have to set PDMODE yourself. (vl-load-com) (defun c:pts2arc ( / *error* c_doc c_spc div sel ent pt typ c_pt s_d s_p e_d d_d isbulge) (defun *error* ( msg ) (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nOops an Error : " msg " occurred."))) (princ) );_end_*error*_defun (setq c_doc (vla-get-activedocument (vlax-get-acad-object)) c_spc (vlax-get-property c_doc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace)) );end_setq (initget 7) (setq div (getint "\nNumber of Points on Arc : ")) (while (setq sel (entsel "\nSelect Arc : ")) (mapcar 'set '(ent pt) sel) (setq typ (cdr (assoc 0 (entget ent)))) (if (wcmatch typ "*POLYLINE") (setq obj (vlax-ename->vla-object ent)) (setq obj nil)) (cond ( (wcmatch typ "*POLYLINE") (setq c_pt (vlax-curve-getclosestpointto ent pt) s_d (vlax-curve-getdistatparam ent (setq s_p (fix (vlax-curve-getparamatpoint ent c_pt)))) e_d (vlax-curve-getdistatparam ent (1+ s_p)) d_d (/ (- e_d s_d) (1- div)) isbulge (if (/= 0.0 (vla-getbulge obj s_p)) T nil) );end_setq ) ( (= typ "ARC") (setq s_d 0.0 d_d (/ (getpropertyvalue ent "Length") (1- div)) );end_setq ) );end_cond (cond ( (or (= typ "ARC") isbulge) (repeat div (vla-addpoint c_spc (vlax-3d-point (vlax-curve-getpointatdist ent s_d))) (setq s_d (+ s_d d_d)) );end_repeat ) ( (alert "Not an Arc")) );end_cond );end_while );end_defun Edited September 23, 2019 by dlanorh clarity Quote
VisDak Posted September 23, 2019 Author Posted September 23, 2019 Thanks dlanorh for the help, Appreciated :) I also check a program that Segment Curve by Lee Mac Thanks also Lee Quote
BIGAL Posted September 24, 2019 Posted September 24, 2019 (edited) The other to look at is a road chainage program this will do increments along a pline. Or just Divide and Measure as built in commands. ARC-to-Multi ARC.lsp Arc-to chords.lsp Edited September 24, 2019 by BIGAL 1 Quote
Recommended Posts
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.