balloons
balloons
(OP)
When I used Autocad 12 in the old days(good old Dos) I had a piece of software called I think Ballona which allowed me to add leaders with ballons or circles for detailing my assembles, is it possible to do this in Autocad 2002.
thanks in advance all thwe best from scotland. Jim





RE: balloons
The below autolisp routine adds a new command to your drawing session. The command's name is LL.
Enter the command LL and pick two points. A leader and a circle will be drawn and then you should enter a number to display in the balloon. The text is created in current text style.
(defun C:LL( / 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)
)
If you need to change some dimensions of balloon or some other modifications, let me know about it.
:)
Farzad
RE: balloons
The text is created in current text style. The text height is 3/32 and the bubble size is 1/4. This text height is based on not having a height assigned to a text style.
(defun C:BUBTAG (/ bs bsr txsz lea txt p tp p1 p2 p3 ang osmod)
(setq bs 0.25) ; Bubble Size
(setq txsz 0.09375) ; Text Size
(setq bs (* (getvar "dimscale") bs)
txsz (* (getvar "dimscale") txsz)
bsr (/ (* (getvar "dimscale") bs) 2)
)
(setvar "cmdecho" 0)
(initget "Y N")
(setq lea (getkword "\nLeader Required? Yes or No: <N> "))
(if (= lea nil)(setq lea "N"))
(setq txt "")
(setq txt (getstring "\nItem Number: <-> "))
(if (= txt "")(setq txt "-"))
(if (or (= lea "N")(= lea "n"))
(progn
(setq p (getpoint "\Bubble Location (by Bottom Quadrant): ")
tp (list (car p) (+ (/ bs 2) (cadr p)))
)
(setq osmod (getvar "OSMODE"))
(setvar "OSMODE" 0)
(command ".circle" tp "d" bs ".text" "m" tp txsz 0 txt)
(setvar "OSMODE" osmod)
)
)
(if (or (= lea "Y")(= lea "y"))
(progn
(setq p1 (getpoint "\nLeader Starting Point: "))
(setq p2 (getpoint p1 "\nBubble Location: "))
(setq ang (angle p1 p2))
(setq p3 (polar p2 ang bsr))
(setq osmod (getvar "osmode"))
(setvar "osmode" 0)
(command ".line" p1 p2 "" ".circle" p3 "d" bs ".text" "m" p3 txsz 0 txt)
(setvar "OSMODE" osmod)
)
)
(princ)
)
SEMott
RE: balloons
Thanks for your quick reply.
jim
RE: balloons
The numbers come out as 0.0000000000 is this correct.
Thanks again Jim
RE: balloons
I have been using AutoCad for 12 years but have never (yet) created a Lisp routine. Would you give me an idiots guide on how to tke your code and make a command available from it?
Best regards
Cameron
RE: balloons
If you access AutoCAD 2000 anywhere, there is a good document for visual LISP (or AutoLISP) in the Help folder of AutoCAD 2000. The file name is VLISPDEV.PDF .
:)
Farzad
RE: balloons
http://www.afralisp.com
BU