PDA

View Full Version : Pause in Qleader?



LT.Seabee
2004-07-08, 08:26 PM
I'm trying to create a routine that will allow me from any layer to run this routine and do a leader & text on the correct layer and THEN go back to the original layer. So far, I'm able to achieve everything other than going back to the original layer. The only success I have had is putting "pause" in the qleader command, but then it gives me an extra "/" or "/P".

Any suggestions?

sinc
2004-07-08, 09:00 PM
Maybe you should post your code so we can see it. I don't think there's enough information in your post to tell what the problem might be.

hot4cad
2004-07-09, 01:16 AM
This is what you need ...
<capture current layer-set desired layer>
(setvar "texteval" 1) ; Force ACAD to accept input
(command "_.qleader") ; Start qleader command
<reset current layer>

hot4cad
2004-07-09, 11:09 AM
oops .. fell asleep at the keyboard last night I think ... lets retry...

<get current layer - set desired layer>
(setvar "texteval" 1) ; Force ACAD to accept input
(setvar "cmdecho" 1) ; Turn cmdecho back on
(command "_.qleader") ; Start qleader command
(while (> (getvar "cmdactive") 0) (command pause))
<do your resets -including "texteval" 0>

Yep thats more like it. :-)

LT.Seabee
2004-07-12, 01:16 PM
Excellent! That did it! Now I can tweak it with some other good MTEXT info and I'll be good. Here is my code in appreciation for the help!


(DEFUN C:AL (/ CLH PT1 PT2 MTW DSC)
(princ "- Architectural Leader -")
(terpri)
(setvar "cmdecho" 0) ;sets command echo
(SETQ DSC (GETVAR "DIMSCALE")) ;sets DSC = Dimscale
(setq ds (getvar "dimstyle")) ;sets DS = Dimstyle
(setq os (getvar "osmode")) ;sets OS = current snap setting
(SETQ CLH (GETVAR "CLAYER")) ;sets CLH = Current Layer
(if (= (tblsearch "layer" "A-ANNO-NOTE") nil)
(command "layer" "m" "A-ANNO-NOTE" "c" 1 "" "")
(setvar "clayer" "A-ANNO-NOTE")
)

(if (= (tblsearch "style" "HPA") nil)
(command "style" "HPA" "ARIAL NARROW" "0" "1" "" "" "" "")
(setvar "textstyle" "HPA")
)
(if (= (tblsearch "dimstyle" "HPA") nil)
(command "dimstyle" "save" "HPA" "")
(command "dimstyle" "restore" "HPA")
)
(PRINC)
(setq PT1 (getpoint "\nSelect First point: "))
(setvar "osmode" 512)
(setq PT2 (getpoint pt1 "\nSelect Second point: "))
(setvar "osmode" os) ;restore osnap setting
(SETQ MTW (* DSC 1.625)) ;sets MTW = Mtext width
(PRINT)
(setvar "texteval" 1)
(setvar "cmdecho" 1)
(COMMAND "_QLEADER" PT1 PT2 "" MTW) ;creates leader & then mtext
(while (> (getvar "cmdactive") 0) (command pause))
(setvar "cmdecho" 0)
(prompt "\nReset to previous layer: ")
(SETVAR "CLAYER" CLH) ;resets current layer
(setvar "texteval" 0)
)
(PRINC)