ktbjx Posted May 3, 2016 Share Posted May 3, 2016 im trying to make a lisp routine that will put leader and text on the arrowhead on leader: arrow size = .5 on text: height = .6 rotation = 90 i kinda got the code from Leemac's label code, what i cant figure out is, the text part. here's my code to see what i mean: (defun c:dip (/ p x y ptcoord textloc txtdp textlabel) (setq p (getpoint " Pick Point: ")) (setq textloc (getpoint " Pick Label Location: ")) (setq txtdp (getstring " Enter Dip: ")) (setq textlabel (strcat txtdp "°")) (setq x (rtos (car p))) (setq y (rtos (cadr p))) (setq z (rtos (caddr p))) ;(setq ptcoord (strcat x ", " yy ", " z)) (command "_LEADER" p textloc "" "" "None" "") (command "_TEXT" "_Justify" "_Middle" p"0.6" "90" textlabel) ) i attached the sample DWG file that i want do be... i don't know how to make the text move further from the arrowhead arrowText.dwg Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 3, 2016 Share Posted May 3, 2016 Hi, Something like this? (defun c:dip (/ e a b d) (if (and (setq e (entlast) a (getpoint "\nSpecify First Point for Leader :")) (setq b (getpoint "\nNext point of Leader :" a)) (setq d (getstring "\nEnter Dip :")) ) (progn (command "_LEADER" "_non" a "_non" b "" "" "None" "") (if (and (/= e (setq e (entlast))) (eq (cdr (assoc 0 (entget e))) "LEADER") ) (command "_TEXT" "_Justify" "_Middle" "_non" (polar a (angle b a) 0.5) "0.6" "90" (strcat d "°")) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
ktbjx Posted May 3, 2016 Author Share Posted May 3, 2016 Hi, Something like this? (defun c:dip (/ e a b d) (if (and (setq e (entlast) a (getpoint "\nSpecify First Point for Leader :")) (setq b (getpoint "\nNext point of Leader :" a)) (setq d (getstring "\nEnter Dip :")) ) (progn (command "_LEADER" "_non" a "_non" b "" "" "None" "") (if (and (/= e (setq e (entlast))) (eq (cdr (assoc 0 (entget e))) "LEADER") ) (command "_TEXT" "_Justify" "_Middle" "_non" (polar a (angle b a) 0.5) "0.6" "90" (strcat d "°")) ) ) ) (princ) ) Exactly what i need! Thank you so much sir! how did you move the text lower on the arrowhead??? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 3, 2016 Share Posted May 3, 2016 Exactly what i need! Thank you so much sir! how did you move the text lower on the arrowhead??? You are welcome:) I did not move the text but I placed the Text in the correct position that you wanted, you can find out that by looking at the Text command to find out. 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.