Jump to content

Leader and text HELP! Leemac's label code


ktbjx

Recommended Posts

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

Link to comment
Share on other sites

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)
 )

Link to comment
Share on other sites

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??? :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...