TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: TJAM51 on December 22, 2004, 02:40:05 PM
-
The following routine allows me to use a single line qleader. What is required to make it have the horizontal tail before the text?
(defun c:LEADHEX (/ pb1 pt1 pt2 lay scl ply agl rtd ang)
(setq pb1 (getvar "PICKBOX"))
(setvar "CMDECHO" 0)
(setq pt1 (getpoint "\nFrom Point: ")
pt2 (getpoint pt1 "\nTo Point: ")
lay (getvar "CLAYER")
scl (getvar "DIMSCALE")
ply (* scl 0.15550)
agl (angle pt1 pt2)
rtd (/ 180 pi)
ang (* rtd agl) )
(command "COLOR" "bylayer")
(setq pt0 (polar pt2 (angle pt2 pt1) ply))
(command ".POLYGON" "6" PT2 "I" PLY)
(setq ent (entlast))
(command ".qleader" "_non" pt1 "_nea" pt0 ^c ^c); create leader only
(entdel ent)
;(command "INSERT" "meinarw" pt1 scl "" ang)
(setq att (getstring "\nEquip_number: "))
(command "INSERT" "MEP-Text-LFTKeyNT1" pt2 scl "" "" att)
(command "SETVAR" "PICKBOX" pb1)
(setvar "CMDECHO" 1)
(pickbox "4")
(princ)
)
-
TJ
Did the routine that Mark or I work for your previous request?
-
It worked great.....
-
From the look of this code I'd say you have copied the qleader command from
the code I posted in your last thread and pasted it into this routine.
Adding a third point is no big deal. In fact I just updated this code, but
I'm surprised you did not acknowledge mine or Mark's efforts.
(defun c:leadhex (/ pb1 pt0 pt1 pt2 pt3 lay scl ply agl rtd ang)
(setq pb1 (getvar "PICKBOX"))
(setvar "CMDECHO" 0)
(setq pt1 (getpoint "\nPick First of 3 Points: ")
pt2 (getpoint pt1 "\nPick 2nd Point: ")
pt3 (getpoint pt2 "\nPick 3rd Point: ")
lay (getvar "CLAYER")
scl (getvar "DIMSCALE")
ply (* scl 0.15550)
agl (angle pt1 pt2)
rtd (/ 180 pi)
ang (* rtd agl)
)
(command "COLOR" "bylayer")
(setq pt0 (polar pt3 (angle pt3 pt2) ply))
(command ".POLYGON" "6" pt3 "I" ply)
(setq ent (entlast))
(command ".qleader" "_non" pt1 "_non" pt2 "_nea" pt0 ^c ^c) ; create leader only
(entdel ent)
(setq att (getstring "\nEquip_number: "))
(command "INSERT" "MEP-Text-LFTKeyNT1" pt3 scl "" "" att)
(command "SETVAR" "PICKBOX" pb1)
(setvar "CMDECHO" 1)
(pickbox "4")
(princ)
)
-
My apologies for not giving credit where credit is due. It was never my intention to not give credit but rather old age and a loack memory. My apologies to both of you. I am very grateful for the assistance you both have proivided.
Thanks you
-
TJ
I wasn't looking for credit, just a simple "That Did It" would do.
The thread was left hanging in my opinion. You left me wondering that's all.