TunzaGibbo Posted December 21, 2018 Author Posted December 21, 2018 Thank you I only knew the last 2 lines. Well done (setq Segments (getreal "\nNumber of Segments::")) (setq ent (car (entsel "\nSelect line :"))) (setq lst (entget ent)) (setq startpoint (cdr (assoc 10 lst))) (setq end (cdr (assoc 11 lst))) (setq len (distance startpoint end)) ;; length (setq ang (angle startpoint end)) (command "_xline" "A" (+ ang 90) startpoint "") (setq Conline (entlast)) (command "_copy" Conline "" "O" "M" startpoint "A" segments (polar startpoint ang (/ len segments))) with this one I have a line and want to insert an XLINE at 90 deg to that line staring at "startpoint" and then copy that the XLINE along "Conline" a distance of "len" divide by "segments" Example: Line 200 long result would be Segments=10 I would have 11 Xlines spaced equally along the 200 line regards Tony Quote
TunzaGibbo Posted December 21, 2018 Author Posted December 21, 2018 Everything works down to the end of the 9th line Quote
TunzaGibbo Posted December 21, 2018 Author Posted December 21, 2018 Thank you I only knew the last 2 lines. Well done (setq Segments (getreal "\nNumber of Segments::")) (setq ent (car (entsel "\nSelect line :"))) (setq lst (entget ent)) (setq startpoint (cdr (assoc 10 lst))) (setq end (cdr (assoc 11 lst))) (setq len (distance startpoint end)) ;; length (setq ang (angle startpoint end)) (command "_xline" "A" (+ ang 90) startpoint "") (setq Conline (entlast)) (command "_copy" Conline "" "O" "M" startpoint "A" segments (polar startpoint ang (/ len segments))) with this one I have a line and want to insert an XLINE at 90 deg to that line staring at "startpoint" and then copy that the XLINE along "Conline" a distance of "len" divide by "segments" Example: Line 200 long result would be Segments=10 I would have 11 Xlines spaced equally along the 200 line Everything works down to the end of the 9th line regards Tony Quote
Grrr Posted December 21, 2018 Posted December 21, 2018 Although I'd use the vlax-curve-* functions... You could try yourself with the polar function to calculate each point where every xline must intersect (by knowing the segment's length). Also your first line doesn't seem correct, perhaps you wanted to use getint ? Quote
BIGAL Posted December 22, 2018 Posted December 22, 2018 Just another hint you can use (entlast) to save the last entity, saves doing a pick object if that’s helpful. 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.