PDA

View Full Version : Is there a way to Automatically set the QLEADER defaults?



anovelli
2004-06-29, 02:57 PM
Is there a way to Automatically set the QLEADER defaults? I have searched but could not find any system variables that define some QLEADER setings. Basically I am trying to get the QLEADER to default to ALWAYS JUSTIFY LEFT instead of PROMPT FOR WIDTH. If anyone know how I can set these in my ACAD.LSP file please let me know. RIght now I have to set them in EVERY drawing. There must be a way to make this happen globally.

BrenBren
2004-06-29, 03:02 PM
You can set them in your template drawing. This is the drawing that AutoCAD opens every time you start a new drawing.

Mike.Perry
2004-06-29, 03:16 PM
Hi

Give the following a try, comes from an old LISP Guild post by Robert Bell -

Here is an alternative function that does not require an external file
(written by one of the Express Tools team):

;|
qlset.lsp - example initialization of QLEADER settings
Frank Whaley, Autodesk

Two functions are included in this file:

(acet-ql-get)
Returns an association list containing the current QLEADER settings from the
Named Object Dictionary.

(acet-ql-get <alist>)
Sets the specified values for QLEADER settings from the given association
list.
Returns an association list containing the new values.

These functions can be used to examine the current QLEADER settings, or to
initialize the setting before using the QLEADER command.
For example, to use splined leaders and framed text:

(acet-ql-set '((65 . 1)(72 . 1)))

Both functions use the following group codes to identify QLEADER settings:

3: user arrowhead block name (default="")
40: default text width (default=0.0)
60: annotation type (default=0)
0=MText
1=copy object
2=Tolerance
3=block
4=none
61: annotation reuse (default=0)
0=none
1=reuse next
62: left attachment point (default=1)
63: right attachment point (default=3)
0=Top of top line
1=Middle of top line
2=Middle of multiline text
3=Middle of bottom line
4=Bottom of bottom line
64: underline bottom line (default=0)
65: use splined leader line (default=0)
66: no limit on points (default=0)
67: maximum number of points (default=3)
68: prompt for MText width (word wrap) (default=1)
69: always left justify (default=0)
70: allowed angle, first segment (default=0)
71: allowed angle, second segment (default=0)
0=Any angle
1=Horizontal
2=90deg
3=45deg
4=30deg
5=15deg
72: frame text (default=0)
170: active tab (default=0)
0=Annotation
1=Leader Line & Arrow
2=Attachment
340: object ID for annotation reuse

|;

(defun acet-ql-get (/ xr cod itm reply)
(if (setq xr (dictsearch (namedobjdict) "AcadDim"))
(progn
(foreach cod
'(3 40 60 61 62 63 64 65 66 67 68 69 70 71 72 170 340)
(if (setq itm (assoc cod xr))
(setq reply (append reply (list itm)))
)
)
reply
)
'((3 . "")
(40 . 0.0)
(60 . 0)
(61 . 1)
(62 . 1)
(63 . 3)
(64 . 0)
(65 . 0)
(66 . 0)
(67 . 3)
(68 . 1)
(69 . 0)
(70 . 0)
(71 . 0)
(72 . 0)
(170 . 0)
)
)
)

(defun acet-ql-set (arg / cur prm)
;; fetch current
(setq cur (acet-ql-get))

;; override per argument
(while arg
(setq prm (car arg)
arg (cdr arg)
cur (subst prm (assoc (car prm) cur) cur)
)
;; handle DIMLDRBLK
(if (= 3 (car prm))
(setvar "DIMLDRBLK" (cdr prm))
)
)

;; put back
(dictremove (namedobjdict) "AcadDim")
(setq
cur (append '((0 . "XRECORD") (100 . "AcDbXrecord") (90 . 990106))
cur
)
)
(dictadd (namedobjdict) "AcadDim" (entmakex cur))

(acet-ql-get)
)

;; load quietly
(princ)


R. Robert Bell, MCSE
AUGI Guild Moderator
www.AcadX.com (http://www.acadx.com/)

************

Have a good one, Mike

vpoon
2006-02-08, 11:04 PM
Can you elaborate on how to set this in the drawing template? thanks


You can set them in your template drawing. This is the drawing that AutoCAD opens every time you start a new drawing.

ccowgill
2006-02-09, 10:40 AM
open a blank drawing, start the QLEADER command, change your settings, draw a leader, erase it, and save the drawing as a DWT file

rkmcswain
2006-02-09, 01:19 PM
Can you elaborate on how to set this in the drawing template? thanks

Run the OPEN command.
In the "Files of Type" drop-down, choose .DWT (Template Files)
Choose your template file from the list to open it
Change your QLEADER settings, and anything else that needs to be set.
Save, and close.

If you are using 2006, you can make this the default template by changing the appropriate setting is OPTIONS. Then the QNEW command will use this.

For earlier versions, just select this template when you start a new drawing.

You only need to follow ccowgill's advise above if you do not have any templates.

Mike.Perry
2006-02-09, 01:34 PM
If you are using 2006, you can make this the default template by changing the appropriate setting is OPTIONS. Then the QNEW command will use this.Hi

Side note, _.QNew first appeared in AutoCAD 2004 [ ID: TP00152 - Quickly start a new drawing (http://usa.autodesk.com/getdoc/id=TP00152) ].

Have a good one, Mike

rkmcswain
2006-02-09, 01:50 PM
Side note, _.QNew first appeared in AutoCAD 2004



Good catch. This 12 month release schedule sort of melts the command sets together..... especially when you don't install each release.

Ed Jobe
2007-01-19, 08:48 PM
Attached is a copy of the code saved as a lisp file.

pbrumberg
2007-06-01, 05:24 PM
I used the lisp routing previously to establish my qleader settings with much success. Now that 2008 has the mleader, does anyone have any sense of how to go about doing this same thing with the mleader settings? Is it another list or are there variables associated with the mleader style similar to dimstyles??