PDA

View Full Version : Multileader lisp help (mtext problem)


FRAMEDNLV
2008-03-06, 09:39 PM
I have been using this routine:
(setq layer1 (getvar "clayer"))
(SETVAR "OSMODE" 512)
(setvar "cmdecho" 1)
(COMMAND "-LAYER" "M" "E-TEXT-NOTE" "C" "R" "" "")
(command "_mleader")
(while (> (logand (getvar "CMDACTIVE") 0) 1)
(command pause )
)
(setvar "clayer" layer1)
(SETVAR "OSMODE" 0)
(princ)

Then I went to add another line after the while loop and it makes my coffee cup leak (see next code).

(setq layer1 (getvar "clayer"))
(SETVAR "OSMODE" 512)
(setvar "cmdecho" 1)
(COMMAND "-LAYER" "M" "E-TEXT-NOTE" "C" "R" "" "")
(command "_mleader")
(while (> (logand (getvar "CMDACTIVE") 0) 1)
(command pause )
)
(command "_DIMBREAK" "L" "A");new line added, but the mleader wasn't finished
(setvar "clayer" layer1)
(SETVAR "OSMODE" 0)
(princ)

Then I changed the cmdactive and it seems to work except that the mtext seems to be on the command line only (see code).

(setq layer1 (getvar "clayer"))
(SETVAR "OSMODE" 512)
(setvar "cmdecho" 1)
(COMMAND "-LAYER" "M" "E-TEXT-NOTE" "C" "R" "" "")
(command "_mleader")
(while (> (getvar "CMDACTIVE") 0)
(command pause))
(COMMAND "_DIMBREAK" "L" "A")
(setvar "clayer" layer1)
(SETVAR "OSMODE" 0)
(princ)

Any way to change the last code to allow me to enter the mtext with the regular mtext editor (so I can get back to my coffee break)?

Thanks,
Chris
Again:
Thanks,
Chris

aaronic_abacus
2008-03-06, 10:36 PM
A guess
(initdia)

From this thread:

http://forums.augi.com/showthread.php?t=76442

FRAMEDNLV
2008-03-06, 10:49 PM
Thanks,
I tried that and it didn't help.

Chris

soxfan07
2008-03-28, 09:45 PM
Not sure what you're trying to accomplish but here is what I use and it works great for me

(defun C:mlead ()
(setvar "cmdecho" 0)
(setq CL (getvar "clayer")
) ;_ end of setq

(COMMAND "-LAYER" "M" "Text" "C" "6" "" "")
(command "cmleaderstyle" "Arrow_Mleader")
(command ".mleader" pause)
(setvar "clayer" CL)
(princ)
)
(setvar "cmdecho" 0)

(princ)

FRAMEDNLV
2008-04-07, 06:58 PM
Not sure what you're trying to accomplish but here is what I use and it works great for me

(defun C:mlead ()
(setvar "cmdecho" 0)
(setq CL (getvar "clayer")
) ;_ end of setq

(COMMAND "-LAYER" "M" "Text" "C" "6" "" "")
(command "cmleaderstyle" "Arrow_Mleader")
(command ".mleader" pause)
(setvar "clayer" CL)
(princ)
)
(setvar "cmdecho" 0)

(princ)


That part works but if I add the next step it will not work:(COMMAND "_DIMBREAK" "L" "" "A")

Chris

d_m_hopper
2008-04-21, 05:40 AM
I had to recreate our old notes that used only leaders to ones using mleaders to take advantage of the new features.....anyway after searching the help menus and this site I found this works very well



(defun c:ductlead ()
(setvar "REGENMODE" 0)
(setvar "cmdecho" 0)
(getvar "measurement")
(if (zerop (getvar "measurement"))
(setq dctxt1 "250mm x 100mm\\PSURFACE WALL DUCT\\PWITH MINIMUM 2 DIVIDERS")
(setq dctxt1 "10\" x 3 1/2\"\\PSURFACE WALL DUCT\\PWITH MINIMUM 2\ DIVIDERS")
)
(setq lyr (getvar "clayer"))
(setq sp (getpoint "\nEnter start point for leader: "))
(command
"_.layer" "_t" "epdjc" "_s" "epdjc" ""
"_.color" "_green" "_celtype" "continuous"
"_.leader" sp pause dctxt1 ""
"layer" "s" lyr ""
)
)
(princ)

this is how it worked with plain old leaders

(defun c:ductlead ()
(setvar "REGENMODE" 0)
(setvar "cmdecho" 0)
(getvar "measurement")
(if (zerop (getvar "measurement"))
(setq dctxt1 "250mm x 100mm")
(setq dctxt1 "10\" x 3 1/2\"")
)
(setq dctxt2 "SURFACE WALL DUCT")
(setq dctxt3 "WITH MINIMUM 2 DIVIDERS")
(setq lyr (getvar "clayer"))
(setq sp (getpoint "\nEnter start point for leader: "))
(command
"_.layer" "_t" "epdjc" "_s" "epdjc" ""
"_.color" "_green" "_celtype" "continuous"
"_.leader" sp pause "" dctxt1 dctxt2 dctxt3 ""
"layer" "s" lyr ""
)
)
(princ)

hopefully something from here helps you out and I am not way off with trying to help

ccowgill
2008-11-13, 06:21 PM
I have been using this routine:
(setq layer1 (getvar "clayer"))
(SETVAR "OSMODE" 512)
(setvar "cmdecho" 1)
(COMMAND "-LAYER" "M" "E-TEXT-NOTE" "C" "R" "" "")
(command "_mleader")
(while (> (logand (getvar "CMDACTIVE") 0) 1)
(command pause )
)
(setvar "clayer" layer1)
(SETVAR "OSMODE" 0)
(princ)Then I went to add another line after the while loop and it makes my coffee cup leak (see next code).

(setq layer1 (getvar "clayer"))
(SETVAR "OSMODE" 512)
(setvar "cmdecho" 1)
(COMMAND "-LAYER" "M" "E-TEXT-NOTE" "C" "R" "" "")
(command "_mleader")
(while (> (logand (getvar "CMDACTIVE") 0) 1)
(command pause )
)
(command "_DIMBREAK" "L" "A");new line added, but the mleader wasn't finished
(setvar "clayer" layer1)
(SETVAR "OSMODE" 0)
(princ)Then I changed the cmdactive and it seems to work except that the mtext seems to be on the command line only (see code).

(setq layer1 (getvar "clayer"))
(SETVAR "OSMODE" 512)
(setvar "cmdecho" 1)
(COMMAND "-LAYER" "M" "E-TEXT-NOTE" "C" "R" "" "")
(command "_mleader")
(while (> (getvar "CMDACTIVE") 0)
(command pause))
(COMMAND "_DIMBREAK" "L" "A")
(setvar "clayer" layer1)
(SETVAR "OSMODE" 0)
(princ)Any way to change the last code to allow me to enter the mtext with the regular mtext editor (so I can get back to my coffee break)?

Thanks,
Chris
Again:
Thanks,
Chris

(initcommand version 2) should allow the mtext editor to pop up instead of command line editing.

robinsonmd
2009-02-04, 11:35 PM
I'm tring to follow the advice on this thread to take a simple lisp routine that sets a multi-leader style and starts the mleader command but I cannot get the mtext editor to come up vs the command line. I added the (initdia) prior to the line (command "mleader"). What am I missing?

ccowgill
2009-02-05, 01:56 PM
I'm tring to follow the advice on this thread to take a simple lisp routine that sets a multi-leader style and starts the mleader command but I cannot get the mtext editor to come up vs the command line. I added the (initdia) prior to the line (command "mleader"). What am I missing?
(initdia) wont work, you need to use (initcommandversion 2), like I stated in my post above