Janax Posted January 14, 2019 Posted January 14, 2019 Hello everyone. I am looking for a way to cut down time on redrawing bend lines (marking for laser ). I need to draw marking lines by selecting entity or two points between line with offset "H" from begining and end and length "L" . Quote
SLW210 Posted January 14, 2019 Posted January 14, 2019 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Quote
David Bethel Posted January 14, 2019 Posted January 14, 2019 Assuming you are dealing with 2D LINE entities only, this could work (defun c:bendl (/ h l ss i en ed p10 p11) (or gv_offset (setq gv_offset 1)) (initget 6) (setq h (getdist (strcat "\nOffset Distance <" (rtos gv_offset 2 2) ">: "))) (or h (setq h gv_offset)) (setq gv_offset h) (or gv_length (setq gv_length 1)) (initget 6) (setq l (getdist (strcat "\nLength Distance <" (rtos gv_length 2 2) ">: "))) (or l (setq l gv_length)) (setq gv_length l) (while (setq ss (ssget (list (cons 0 "LINE")))) (setq i 0) (while (setq en (ssname ss i)) (setq ed (entget en) p10 (cdr (assoc 10 ed)) p11 (cdr (assoc 11 ed))) (entmake (list (cons 0 "LINE") (assoc 8 ed) (cons 62 1) (cons 10 (polar p10 (angle p10 p11) h)) (cons 11 (polar p10 (angle p10 p11) (+ h l))))) (entmake (list (cons 0 "LINE") (cons 62 1) (cons 10 (polar p11 (angle p11 p10) h)) (cons 11 (polar p11 (angle p11 p10) (+ h l))))) (setq i (1+ i)))) (prin1)) -David 1 Quote
Janax Posted January 14, 2019 Author Posted January 14, 2019 Thank you David. You saved me alot of time Quote
David Bethel Posted January 14, 2019 Posted January 14, 2019 You're welcome. You could customize this into a lot of things. -David 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.