Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Draw a Balloon with Leader 1

Status
Not open for further replies.

wzal

Mechanical
Mar 18, 2004
35
0
0
US
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,
 
Replies continue below

Recommended for you

Here is a ballon routine from Catalyst magazine.
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)
 
This is not quite the same, but if you use DDIM to change the style to "Draw Frame Around Text" which used to be called a "Basic Dimension" then the leader text will have a rectangular box drawn around it. Your leaders will remain associative and you will have all the advantages of the "balloons" being dimensions.
 
Make a circle with a half inch dia. circle(keeping in mind the drawing scale factor);attach a leader to the balloon; make an attribute of a character(letter or number) and insert it inside the balloon; make the ballon and its inserted character as a block or wblock which can be reinserted and modifies in existing or new drawings. only use wblocks for new drawings since wblocks can be saved in the same manner as drawing files; also make the attribute before making the block or wblock.
 
Hi guys,
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
 
how do you guys keep yourselves from making mistakes when .lsp routines are written?. It seems like it would not be difficult to forget a parenthese here and there.
 
Status
Not open for further replies.
Back
Top