rookie37 Posted July 12, 2007 Share Posted July 12, 2007 how do I draw a balloon? (circle with text in it and a leader with an arrow head pointing to the part) I'm sure there is an easier way than the way I'm doing it. I'm still doing it the same as I did it in Autocad 9 Quote Link to comment Share on other sites More sharing options...
Strix Posted July 12, 2007 Share Posted July 12, 2007 with the LEADER command in dimensions? there is a variable you can set to make your leader come out in different formats, but I'm afraid I've forgotten what that variable is and I can't go look on this computer Quote Link to comment Share on other sites More sharing options...
Guest Alan Cullen Posted July 12, 2007 Share Posted July 12, 2007 Strix......you gotta do something about being cadless at home....... Quote Link to comment Share on other sites More sharing options...
Strix Posted July 12, 2007 Share Posted July 12, 2007 I'm not cadless at home - I'm just cadless on my new laptop I've got LT98 on the PC and I think it's 2002 on the old laptop - but it's slow and cranky Quote Link to comment Share on other sites More sharing options...
Norts Posted July 12, 2007 Share Posted July 12, 2007 ....but it's slow and cranky sounds a bit like someone i know Quote Link to comment Share on other sites More sharing options...
Guest Alan Cullen Posted July 12, 2007 Share Posted July 12, 2007 sounds a bit like someone i know Yeah.....Strix........or are talking about ME, Blue......?????? :lol: Quote Link to comment Share on other sites More sharing options...
Norts Posted July 12, 2007 Share Posted July 12, 2007 Yeah.....Strix........or are talking about ME, Blue......?????? :lol: Was thinking more about myself, certainly the latter part of the sentence. C'mon Strix, make your 500th post a good 'un Quote Link to comment Share on other sites More sharing options...
Strix Posted July 12, 2007 Share Posted July 12, 2007 so here's me sat here wondering whether I should suggest I'd read your 'somebody I know' post as being you but you beat me to it Norts do I have to start a new thread for my 500th? Quote Link to comment Share on other sites More sharing options...
Guest Alan Cullen Posted July 12, 2007 Share Posted July 12, 2007 yeah.....in the chat area.....in the appropriate thread..... Quote Link to comment Share on other sites More sharing options...
Norts Posted July 12, 2007 Share Posted July 12, 2007 do I have to start a new thread for my 500th? I would say the answer is a 'yep, sure do' providing you want a fanfare and all the trimmings Quote Link to comment Share on other sites More sharing options...
rookie37 Posted July 15, 2007 Author Share Posted July 15, 2007 Iv'e had a look at the leader command. I couldn't find how to set is as a balloon. Quote Link to comment Share on other sites More sharing options...
Cad64 Posted July 15, 2007 Share Posted July 15, 2007 First you have to create a block containing the circle and whatever attributes you want to use for your callout. Then start the LEADER command. The first time you initiate the LEADER command, type S for Settings. This will open the "Leader Settings" dialog. Click on the "Annotation" tab and select "Block Reference" from the "Annotation Type" section. Hit "OK" to exit the dialog and get back into the Leader command. Now draw out your leader. Once you place your 3rd point, you will be asked to specify the name of the block you want to use as your callout. Type in the name of the block you just created and hit enter. You can now place the block at the end of the leader by selecting the "Basepoint" option from the command line. Using your Quadrant & Endpt Osnaps, click on a quadrant of the circle and then click on the endpoint of the leader to set the block. Accept the defaults for scale and rotation and the block will then be attached to the leader. So now if you move the block, the leader will stretch and stay attached to the block. Hope that helps. Quote Link to comment Share on other sites More sharing options...
Biscuits Posted July 19, 2007 Share Posted July 19, 2007 Rookie37: A PM has been sent Quote Link to comment Share on other sites More sharing options...
rookie37 Posted July 19, 2007 Author Share Posted July 19, 2007 Biscuits I'd be very interested in the balloon lisp routine. Thank you Is the email address correct? Quote Link to comment Share on other sites More sharing options...
Biscuits Posted July 19, 2007 Share Posted July 19, 2007 I'll sent them tomorrow when I get to work Quote Link to comment Share on other sites More sharing options...
Cad64 Posted July 20, 2007 Share Posted July 20, 2007 So you're not going to share with the rest of us? If you've got a good lisp routine, post it up. It may be useful to others. Quote Link to comment Share on other sites More sharing options...
dbroada Posted July 20, 2007 Share Posted July 20, 2007 So you're not going to share with the rest of us? If you've got a good lisp routine, post it up. It may be useful to others. I'll share a VBA routine with you then. Its a long time since I used it so it may not work though. Paste this lot into your VBA editor as a new module Option Explicit Public Sub Arw(Optional LType As Integer) Dim P1 As Variant, P3 As Variant Dim Pa(0 To As Double, Pd(0 To 11) As Double Dim myArrow As AcadLeader Dim annotationObject As AcadObject Dim myCircle As AcadCircle Dim myDonut As AcadLWPolyline Dim myText As AcadText Dim myLayer As AcadLayer Dim LayEx1 As Boolean, LayEx2 As Boolean Dim txtItem As String, txtQuan As String Dim myScale, CircleRad, Prompt$ Dim defItemLayer As String, defQLayer As String Dim LeaderDir As Integer, i As Integer, CurrentQ As Integer On Error Resume Next defItemLayer = "ItemNo" defQLayer = "ItemQ" myScale = ThisDrawing.GetVariable("DIMSCALE") CircleRad = 5 * myScale CurrentQ = ThisDrawing.GetVariable("USERI5") + 1 For i = 0 To ThisDrawing.Layers.Count - 1 If ThisDrawing.Layers.Item(i).Name = defItemLayer Then LayEx1 = True If ThisDrawing.Layers.Item(i).Name = defQLayer Then LayEx2 = True Next If Not LayEx1 Then ThisDrawing.Layers.Add (defItemLayer) ThisDrawing.Layers.Item(defItemLayer).color = acGreen End If If Not LayEx2 Then ThisDrawing.Layers.Add (defQLayer) ThisDrawing.Layers.Item(defQLayer).color = acMagenta End If Set annotationObject = Nothing P1 = ThisDrawing.Utility.GetPoint(, "Leader start") If Err <> 0 Then Exit Sub P3 = ThisDrawing.Utility.GetPoint(P1, "item centre ") If P1(0) < P3(0) Then LeaderDir = 1 Else LeaderDir = -1 Pa(0) = P1(0): Pa(1) = P1(1): Pa(2) = P1(2) Pa(3) = P3(0) - 1.5 * CircleRad * LeaderDir: Pa(4) = P3(1): Pa(5) = P3(2) Pa(6) = P3(0) - CircleRad * LeaderDir: Pa(7) = Pa(4): Pa( = Pa(5) Prompt$ = "Item no. <" & Trim(CurrentQ) & "> " txtItem = ThisDrawing.Utility.GetString(False, Prompt$) If txtItem = "" Then txtItem = Trim(CurrentQ) CurrentQ = txtItem ThisDrawing.SetVariable "USERI5", CurrentQ txtQuan = ThisDrawing.Utility.GetString(False, "No off ") 'force LType to withArrow until donut sorted 'LType = 2 If LType = 0 Then Pd(0) = Pa(0) - 0.25 * myScale Pd(1) = Pa(1) Pd(2) = Pa(0) + 0.25 * myScale Pd(3) = Pa(1) Pd(4) = Pd(0) Pd(5) = Pd(1) Pd(6) = Pa(0) Pd(7) = Pa(1) Pd( = Pa(3) Pd(9) = Pa(4) Pd(10) = Pa(6) Pd(11) = Pa(7) Set myDonut = ThisDrawing.ModelSpace.AddLightWeightPolyline(Pd) myDonut.SetBulge 0, 1 myDonut.SetBulge 1, 1 myDonut.ConstantWidth = 0 myDonut.SetWidth 0, myScale / 2, myScale / 2 myDonut.SetWidth 1, myScale / 2, myScale / 2 Else Set myArrow = ThisDrawing.ModelSpace.AddLeader(Pa, annotationObject, LType) End If Set myCircle = ThisDrawing.ModelSpace.AddCircle(P3, CircleRad) Set myText = ThisDrawing.ModelSpace.AddText(txtItem, P3, 3.5 * myScale) myText.Alignment = acAlignmentMiddle myText.TextAlignmentPoint = P3 myText.Layer = "ItemNo" myText.ScaleFactor = 0.8 myCircle.color = acCyan If txtQuan <> "" Then 'ADD 2nd text line here P3(0) = P3(0) + CircleRad P3(1) = P3(1) + 0.5 * CircleRad Set myText = ThisDrawing.ModelSpace.AddText(txtQuan, P3, 2.5 * myScale) myText.Layer = "ItemQ" myText.ScaleFactor = 0.8 End If End Sub Public Sub ItemArrow() Call Arw(2) End Sub Public Sub ItemBlob() Call Arw(0) End Sub and start with ^C^Cvbastmt;arw(2); Quote Link to comment Share on other sites More sharing options...
paulmcz Posted July 20, 2007 Share Posted July 20, 2007 Here is one I use : ;; by paulmcz (defun incr () (princ "\n Increment part numbers? <Y>:") (setq ans (getstring)) (if (or (= ans "n")(= ans "N"))() (if (= ans "")(progn (setq inn2 (atoi inn)) (setq inn3 (1+ inn2)) (setq inn (itoa inn3)))(setq inn ans) )) (setq sl (strlen inn)) (if (or (= ans "n")(= ans "N"))() (cond ((= sl 1)(setq inn (strcat "00" inn))) ((= sl 2)(setq inn (strcat "0" inn))) (T nil) )) ) (defun c:bn (/ in is) (setq cmd (getvar "cmdecho") osm (getvar "osmode") ) (setvar "cmdecho" 0) (setq is (getpoint "\n Arrow point: ")) (setq cc (getpoint is "\n Center point of balloon: ")) (if inn () (setq inn "000") ) (incr) (princ "\n Part number < ") (princ inn) (princ " >? :") (setq in (getstring)) (if (= in "") (setq in inn) ) (setq inn in) (if imm () (setq imm "000")) (princ "\n Sheet number < ") (princ imm) (princ " >? :") (setq im (getstring)) (if (= im "")(setq im imm)) (setq imm im) (setq ds (getvar "dimscale")) (if (and (> ds 0)(/= ds nil)) ()(setq ds 1.0)) (setq th (getvar "dimtxt")) (setq cd (* th 4.0)) (setq dia (* cd ds)) (setq txt (* th ds)) (setq rad (/ dia 2)) (setq ptl1 (list (- (car cc) rad) (cadr cc))) (setq ptl2 (list (+ (car cc) rad) (cadr cc))) (setq ptt1 (list (car cc) (+ (cadr cc) (* 0.8 txt)))) (setq ptt2 (list (car cc) (- (cadr cc) (* 0.8 txt)))) (setvar "osmode" 0) (command "circle" cc rad) (command ".line" ptl1 ptl2 "") (entmake (list (cons 0 "TEXT") (cons 10 ptt1) (cons 11 ptt1) (cons 1 in) (cons 7 (getvar "TEXTSTYLE")) (cons 40 (* txt 0.) (cons 72 4) ) ) (entmake (list (cons 0 "TEXT") (cons 10 ptt2) (cons 11 ptt2) (cons 1 im) (cons 7 (getvar "TEXTSTYLE")) (cons 40 (* txt 0.) (cons 72 4) ) ) (command "leader" is (polar is (angle is cc) (- (distance is cc) rad) ) "" "" "n" ^c^c ) (setvar "cmdecho" cmd) (setvar "osmode" osm) (princ) ) (prompt "\ntype < bn > to start Split Balloon with Leader") ;; Original version by Mr Randy Quote Link to comment Share on other sites More sharing options...
Biscuits Posted July 20, 2007 Share Posted July 20, 2007 Here are the (2) lisp routines I promised to create balloons using plain text. I do have another one (if anyone is interested) that will create attributes rather than plain text. Feel free to use and modify as you wish. The first one uses arrowheads that snap (nearest) and the second one uses a dot without any osnaps used. The leader, balloon, and text size are created based on current dimscale. They work on all versions of autocad since 2002, they are a bit old, and could probably have been done a little cleaner. But they work great for me. Let me know if I can be of further help. (defun c:bln-a (/ cc in is) (prompt "Balloon") (command "dimasz" ".09375") (command "._-LAYER" "_NEW" "DIM" "_COLOR" 1 "DIM" "" "") (command "LAYER" "SET" "DIM" "") (command "dimldrblk" ".") (setq cmd (getvar "cmdecho")) (setvar "osmode" 512) (setvar "cmdecho" 0) (terpri)(setq is (getpoint "Start point of Leader:")) (terpri)(setq cc (getpoint is "Center of Balloon:")) (terpri)(setq ds (getvar "dimscale")) (terpri)(setq th (getvar "dimtxt")) (terpri)(setq cd (getvar "dimdli")) (terpri)(setq rad (* th 3)) (terpri)(setq txt (* th ds)) (terpri)(setq dia (* rad ds)) (command ".circle" "_non" cc "d" dia) (command "-STYLE" "STANDARD" "" "" "" "" "" "" "") (command "Qleader" "_non" is "_non" (polar is (angle is cc) (- (distance is cc) (/ dia 2))) c^c^) (terpri)(setq in (getstring "Text in Balloon:")) (command ".text" "m" "_non" cc txt 0 in) (setvar "cmdecho" cmd) (setvar "osmode" 47) (princ) ) (defun c:bln-b (/ cc in is) (prompt "Balloon") (command "dimasz" ".06") (command "._-LAYER" "_NEW" "DIM" "_COLOR" 1 "DIM" "" "") (command "LAYER" "SET" "DIM" "") (command "dimldrblk" "dot") (setq cmd (getvar "cmdecho")) (setvar "osmode" 0) (setvar "cmdecho" 0) (terpri)(setq is (getpoint "Start point of Leader:")) (terpri)(setq cc (getpoint is "Center of Balloon:")) (terpri)(setq ds (getvar "dimscale")) (terpri)(setq th (getvar "dimtxt")) (terpri)(setq cd (getvar "dimdli")) (terpri)(setq rad (* th 3)) (terpri)(setq txt (* th ds)) (terpri)(setq dia (* rad ds)) (command ".circle" cc "d" dia) (COMMAND "-STYLE" "STANDARD" "" "" "" "" "" "" "") (command "Qleader" is (polar is (angle is cc) (-(distance is cc)(/ dia 2))) c^c^) (terpri)(setq in (getstring "Text in Balloon:")) (command ".text" "m" cc txt 0 in) (setvar "cmdecho" cmd) (setvar "osmode" 47) (command "dimldrblk" ".") (command "dimasz" ".09375") (princ) ) Quote Link to comment Share on other sites More sharing options...
El Jefe '36 Posted September 18, 2007 Share Posted September 18, 2007 Any lisp routines to create balloons using Mtext? We don't use leaders on our ballons, instead we have a solid object from the box pointing to the object. We have a lisp routine for this to only work with plain text, but we would love one to work with Mtext. I can supply the plain text lisp routine if it can help create one to work with Mtext. Let me know. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.