TheSwamp

CAD Forums => CAD General => Topic started by: Rotring on October 15, 2004, 01:02:46 AM

Title: Qleader annotation
Post by: Rotring on October 15, 2004, 01:02:46 AM
Is there a way in Acad 2005 when using qleader, to set 'annotation type' to none without going through the dialog box and have that as a default setting?
Title: Qleader annotation
Post by: PDJ on October 15, 2004, 03:42:45 PM
Don't I wish.. I tried figuring that one out myself  for a few days.. I don't see any way that you can execute the command from the command line, therein lies my problem..
Title: Qleader annotation
Post by: M-dub on October 15, 2004, 03:59:21 PM
I don't know about 2005, but I have two custom buttons that I use...

^C^Cleader;\\;;n;

^C^Cleader;\\\;;n;
Title: Qleader annotation
Post by: PDJ on October 15, 2004, 08:31:19 PM
Real cadd operators don't use buttons.. :D
Title: Qleader annotation
Post by: Keith™ on October 15, 2004, 11:10:13 PM
That's a low blow there Paul .....
It seems to me that I remember something about the qleader settings being stored in a dictionary in the drawing... cannot remember where I saw that ... maybe we could investigate...

EDITED .....

The dictionary that the data is stored in is AcadDim ...

You can retrieve it by ....
Code: [Select]

(dictsearch (dictobjname) "AcadDim")


You can also entmod it from there ...

A few of the DXF group codes I have explored are:
62 = Left alignment 0-4
63 = Right alignment 0-4
65 = Leader type 0 = line 1 = spline
67 = number of segments > 0
40 = annotation width


I have not looked at the other info, but I am sue with a little time you can figure the rest out....
Title: Qleader annotation
Post by: CAB on October 18, 2004, 06:04:46 PM
Try this
(acet-ql-set '((60 . 4)))

Code: [Select]
;;
;;  qlset.lsp - example initialization of QLEADER settings
;;    Frank Whaley    Autodesk, Inc.
;;  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)
  (setq cur (acet-ql-get));  fetch current
  ;;  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)
)

(princ);  load quietly
Title: Qleader annotation
Post by: Keith™ on October 18, 2004, 09:42:59 PM
I just knew that CAB would have something up his sleeve....
Title: Qleader annotation
Post by: CAB on October 18, 2004, 09:59:14 PM
Can't always create em, but I got quite a library of borrowed code.
Almost as much as t-bear. :)
Title: Qleader annotation
Post by: Rotring on October 18, 2004, 11:58:43 PM
Thanks guys (and gals)