How to Draw a Balloon with Leader
How to Draw a Balloon with Leader
(OP)
Hi,
I am new to Autocad. When I used Leader Command to link an object with a balloon (I left Text empty). The leader came with a tail.
I gather it is not the right way to do the job. How should it be done?
R2004
Thanks,
I am new to Autocad. When I used Leader Command to link an object with a balloon (I left Text empty). The leader came with a tail.
I gather it is not the right way to do the job. How should it be done?
R2004
Thanks,





RE: How to Draw a Balloon with Leader
Cut and past into an empty notepad session, save as ballon.lsp, the load it and type bln to start the routine.
;Tip1517: BALLOON.LSP Ultimate Balloon (c)1999, Brent Wilkerson
(defun c:BLN (/ PT1 PT2 PT3 ANG TXT CIRSZ OLD_OS DIMSC)
(setvar "CMDECHO" 0)
(command "undo" "m" "undo" "g")
(setq OLD_OS (getvar "OSMODE"))
(setq PT1 (getpoint "\nLeader Start Point: "))
(while (/= PT1 nil)
(setq DIMSC (getvar "DIMSCALE"))
(setq PT2 (getpoint PT1 "\n Bubble Startpoint: "))
(setq ANG (angle PT1 PT2))
(setvar "osmode" 0)
(command "dim1" "leader" PT1 PT2) (command)
(setq PT3 (getpoint PT2 "\n Next point (ENTER to stop):"))
(while (/= PT3 nil)
(command "LINE" PT2 PT3 "")
(setq ANG (angle PT2 PT3))
(setq PT2 PT3)
(setq PT3 (getpoint PT2 "\nNext point (ENTER to stop):"))
)
; Adjust circle size near the "5" is times the dimension text height
; times the dimension scale. Adjust the "5" to vary your circle size.
(setq CIRSZ (* (* DIMSC (getvar "DIMTXT")) 5))
;;
(command "circle" "2p" PT2 (polar PT2 ANG CIRSZ))
(setq TXT (getstring T "\n Bubble text: "))
(command "TEXT" "M"
(polar PT2 ANG (/ CIRSZ 2)) (* DIMSC (getvar "DIMTXT")) 0 TXT)
(setvar "OSMODE" OLD_OS)
(princ "\n*Hit <ENTER> to exit*")
(setq PT1 (getpoint "\nLeader Start Point: "))
)
(setq PT1 nil)
(setvar "OSMODE" OLD_OS)
(command "undo" "e")
(setvar "CMDECHO" 1)
(princ)
)
(princ "\nEnter BLN to start routine.")
(princ)
RE: How to Draw a Balloon with Leader
To get a straight line leader without a shoulder stop specifying points after your second one by pressing the enter key.
RE: How to Draw a Balloon with Leader
RE: How to Draw a Balloon with Leader
HTH
Dave
RE: How to Draw a Balloon with Leader
RE: How to Draw a Balloon with Leader
Try the following code. I have wrote and used it for a long time with no problem.
(defun C:LB( / temp_list p1 p2 p3 n label_text rot_list )
(setvar "CMDECHO" 0)
(command "._UNDO" "BE")
(setvar "CMDECHO" 1)
(command "._LEADER" pause pause "" "" "N")
(setq temp_list (entget (entlast)))
(setq n 16)
(while (/= (car (nth n temp_list)) 10)
(setq n (1+ n))
)
(setq p1 (cdr (nth n temp_list)))
(setq p2 (cdr (nth (1+ n) temp_list)))
(setq p3 (polar p2 (angle p1 p2) 3.0))
(setq p3 (trans p3 0 1))
(setvar "CMDECHO" 0)
(setq old_snap (getvar "OSMODE"))
(setvar "OSMODE" 0)
(command "._CIRCLE" p3 3.0)
(setq label_text (getstring t "\n Label text : "))
(command "._TEXT" "J" "M" p3 3.0 0.0 label_text)
(setvar "OSMODE" old_snap)
(setq old_snap nil)
(setq temp_list (entget (entlast)))
(setq rot_list (assoc 50 temp_list))
(setq temp_list (subst '(50 . 0.0) rot_list temp_list))
(entmod temp_list)
(command "._UNDO" "E")
(princ)
)
After loading the code, enter the LB command and just pick two positions.
:)
Farzad
RE: How to Draw a Balloon with Leader