Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with QLeader thru LISP

3 REPLIES 3
Reply
Message 1 of 4
justin84.thomas
254 Views, 3 Replies

Issue with QLeader thru LISP

Guys,

Here's the sample of my code:

(defun c:wds_qleader ()
(setq old-layer (getvar "clayer"))
(setvar "clayer" "G-ANNO-DIMS")
(command "._qleader")
(while
(> (getvar "cmdactive") 0)
(command pause)
)
(setvar "clayer" old-layer)_
(princ)
)

It'd wind up in a loop and I couldn't stop it after I pushed ENTER. How do I fix that?
3 REPLIES 3
Message 2 of 4

Hi,
put
(setvar "texteval" 1)
before
(command "._qleader")

Regards Ian
Message 3 of 4

It worked. Thanks.

Now my next question is how can I alter the settings without having to use dialog for Qleader?

Thanks,

Justin
Message 4 of 4
arcticad
in reply to: justin84.thomas

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 )
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

{code}

(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)
{code}
---------------------------



(defun botsbuildbots() (botsbuildbots))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost