siyadaliek Posted January 8, 2019 Share Posted January 8, 2019 Sir, i am using one lisp which gives me the total length of the selected line , but please anyone can edit the lisp by adding, the total length i need to write r in the drawing with a leader line (defun C:33 (/ ss tl n ent itm obj l) (setq ss (ssget) tl 0 n (1- (sslength ss))) (while (>= n 0) (setq ent (entget (setq itm (ssname ss n))) obj (cdr (assoc 0 ent)) l (cond ((= obj "LINE") (distance (cdr (assoc 10 ent))(cdr (assoc 11 ent)))) ((= obj "ARC") (* (cdr (assoc 40 ent)) (if (minusp (setq l (- (cdr (assoc 51 ent)) (cdr (assoc 50 ent))))) (+ pi pi l) l))) ((or (= obj "CIRCLE")(= obj "SPLINE")(= obj "POLYLINE") (= obj "LWPOLYLINE")(= obj "ELLIPSE")) (command "_.area" "_o" itm) (getvar "perimeter")) (T 0)) tl (+ tl l) n (1- n))) (alert (strcat "Total length of selected objects is " (rtos tl))) (princ) ) Quote Link to comment Share on other sites More sharing options...
joemcanciller Posted January 8, 2019 Share Posted January 8, 2019 If I got your question right. Change the line (alert (strcat "Total length of selected objects is " (rtos tl))) into (setvar "cmleaderstyle" "standard") (command "_mleader" pause pause (rtos tl)) Quote Link to comment Share on other sites More sharing options...
siyadaliek Posted January 8, 2019 Author Share Posted January 8, 2019 Thank you Jeomcanciller ... its works Quote Link to comment Share on other sites More sharing options...
joemcanciller Posted January 8, 2019 Share Posted January 8, 2019 2 hours ago, siyadaliek said: Thank you Jeomcanciller ... its works No problem. I just learned those in this forum. You'll learn a lot here. Quote Link to comment Share on other sites More sharing options...
joemcanciller Posted January 8, 2019 Share Posted January 8, 2019 You got that code here http://www.turvill.com/t2/free_stuff/tlen.lsp Am I right? Enjoy! Quote Link to comment Share on other sites More sharing options...
siyadaliek Posted January 8, 2019 Author Share Posted January 8, 2019 Thank you sir , i tried a lot to learn but i believe it need some programming knowledge Quote Link to comment Share on other sites More sharing options...
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.