cedwards 发表于 2022-7-6 07:20:18

QLeader Setup Lisp - AutoCAD 1

Greetings everyone!
 
I have a lisp that was found a few years ago(possibly on this site) that would change qleader settings on the fly.It has worked flawlessly until we upgraded from AutoCAD 2012 to 2013.It no longer will set the the Annotation Type, Leader Line or Number of Points.
 
If someone has any suggestions on how to modify the lisp it would be greatly appreciated!
 
 

(defun c:nldr()   (acet-ql-set '((60 . 4)(65 . 0)(66 . 1)(70 . 0)(71 . 0)))   (SETVAR "DIMLDRBLK" ".")   (command "QLEADER"))(defun c:aldr()   (acet-ql-set '((60 . 4)(65 . 0)(66 . 1)(70 . 0)(71 . 0)))   (SETVAR "DIMLDRBLK" "LOOP")   (command "QLEADER"))(defun c:hr()   (acet-ql-set '((60 . 4)(65 . 1)(66 . 0)(67 . 3)(70 . 0)(71 . 0)))   (SETVAR "DIMLDRBLK" ".")   (command "QLEADER"));;;;   2.19.2002 Rob Tomson;;    (acet-ql-get);;      Returns an association list containing the current QLEADER;;      settings from the Named Object Dictionary.;;;;    (acet-ql-get );;      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 . 4)   (61 . 0)   (62 . 1)   (63 . 1)   (64 . 0)   (65 . 0)   (66 . 0)   (67 . 3)   (68 . 0)   (69 . 0)   (70 . 0)   (71 . 2)   (72 . 0)   (170 . 0)    ) ))(defun acet-ql-set (arg / cur prm) (setq cur (acet-ql-get)) (while arg   (setq prm (car arg)         arg (cdr arg)         cur (subst prm (assoc (car prm) cur) cur)   )   (if (= 3 (car prm))   (setvar "DIMLDRBLK" (cdr prm))   ) ) (dictremove (namedobjdict) "AcadDim") (setq         cur (append '((0 . "XRECORD") (100 . "AcDbXrecord") (90 . 990106)) cur) ) (dictadd (namedobjdict) "AcadDim" (entmakex cur)) (acet-ql-get))(princ)(acet-ql-set '((3 . "")   (40 . 0.0)   (60 . 4)   (61 . 0)   (62 . 1)   (63 . 1)   (64 . 0)   (65 . 0)   (66 . 0)   (67 . 3)   (68 . 0)   (69 . 0)   (70 . 0)   (71 . 2)   (72 . 1)   (170 . 0)));;

David Bethel 发表于 2022-7-6 07:36:04

I had to laugh after I first read this.Neither Release 12 or Release 13 had QLEADER commands.However 2012 & 2013 both have it.I'm showing my age....
 
Sorry but I can't help you.-David

cedwards 发表于 2022-7-6 08:01:02

lol...I guess I will edit the post a little to make it a little clearer. Thanks for looking

rkent 发表于 2022-7-6 08:08:38

Do yourself a favor and move to mleaders, you will quickly forget all about qleader.

BlackBox 发表于 2022-7-6 08:28:17

 
I mostly agree with moving to MLeader in lieu of QLeader... The one thing that irks me is functionality that QLeader had, not being possible with MLeader, such as when you want to reposition the QLeader's MText, you could use the Move command on the MText and use the QLeader End & Mid points... Not so with MLeader.
页: [1]
查看完整版本: QLeader Setup Lisp - AutoCAD 1