|
Welcome, Guest.
|
||||||
| AutoLISP AutoLISP or Visual LISP, learn both here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: 2004-07
Posts: 17
![]() ![]() |
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? |
|
|
|
|
|
#2 |
|
AUGI Addict
Join Date: 2004-02
Location: Colorado
Posts: 1,531
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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.
|
|
|
|
|
|
#3 |
|
Member
Join Date: 2001-02
Posts: 4
![]() |
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> |
|
|
|
|
|
#4 |
|
Member
Join Date: 2001-02
Posts: 4
![]() |
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. |
|
|
|
|
|
#5 |
|
Member
Join Date: 2004-07
Posts: 17
![]() ![]() |
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!
Code:
(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) Last edited by Glenndp : 2004-07-12 at 03:20 PM. Reason: Placed routine in code tag |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is there a way to Automatically set the QLEADER defaults? | anovelli | AutoCAD Customization | 9 | 2007-06-01 07:24 PM |
| QLeader with MText does not honour MText Line Spacing setting | anovelli | AutoCAD General | 8 | 2007-03-12 04:18 AM |
| QLEADER Stuff | psuchewinner | AutoLISP | 8 | 2004-07-09 08:47 AM |
| QLEADER SETTINGS | anovelli | AutoCAD "Original" Wish List (Archived) | 2 | 2004-06-30 09:52 AM |