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!

balloons

Status
Not open for further replies.

jimp178

Mechanical
Apr 23, 2001
58
0
0
GB

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
 
Replies continue below

Recommended for you

Dear jimp178,

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
 
Here's a lisp file that was used in release 12 to 2002.
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 &quot;\nLeader Required? Yes or No: <N> &quot;))
(if (= lea nil)(setq lea &quot;N&quot;))
(setq txt &quot;&quot;)
(setq txt (getstring &quot;\nItem Number: <-> &quot;))
(if (= txt &quot;&quot;)(setq txt &quot;-&quot;))
(if (or (= lea &quot;N&quot;)(= lea &quot;n&quot;))
(progn
(setq p (getpoint &quot;\Bubble Location (by Bottom Quadrant): &quot;)
tp (list (car p) (+ (/ bs 2) (cadr p)))
)
(setq osmod (getvar &quot;OSMODE&quot;))
(setvar &quot;OSMODE&quot; 0)
(command &quot;.circle&quot; tp &quot;d&quot; bs &quot;.text&quot; &quot;m&quot; tp txsz 0 txt)
(setvar &quot;OSMODE&quot; osmod)
)
)
(if (or (= lea &quot;Y&quot;)(= lea &quot;y&quot;))
(progn
(setq p1 (getpoint &quot;\nLeader Starting Point: &quot;))
(setq p2 (getpoint p1 &quot;\nBubble Location: &quot;))
(setq ang (angle p1 p2))
(setq p3 (polar p2 ang bsr))
(setq osmod (getvar &quot;osmode&quot;))
(setvar &quot;osmode&quot; 0)
(command &quot;.line&quot; p1 p2 &quot;&quot; &quot;.circle&quot; p3 &quot;d&quot; bs &quot;.text&quot; &quot;m&quot; p3 txsz 0 txt)
(setvar &quot;OSMODE&quot; osmod)
)
)
(princ)
)


SEMott
 
Thanks Farzad Do I copy your file in notepad with lsp extension to the Autocad2000\support directory.

Thanks for your quick reply.

jim
 
Farzad Worked it out I forgot to load the lisp file.

The numbers come out as 0.0000000000 is this correct.

Thanks again Jim
 
Hi guys!
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
 
Dear Cameronke,
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
 
Status
Not open for further replies.

Similar threads

Back
Top