See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Multileader lisp help (mtext problem)

  1. #1
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Multileader lisp help (mtext problem)

    I have been using this routine:
    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 )
    )
    (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).

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

    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

  2. #2
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    A guess
    (initdia)

    From this thread:

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

  3. #3
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    Thanks,
    I tried that and it didn't help.

    Chris

  4. #4
    Member
    Join Date
    2008-03
    Posts
    10
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    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)

  5. #5
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    Quote Originally Posted by soxfan07 View Post
    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 workCOMMAND "_DIMBREAK" "L" "" "A")

    Chris

  6. #6
    I could stop if I wanted to
    Join Date
    2007-05
    Location
    Brookfield WI
    Posts
    331
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    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



    Code:
    (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

    Code:
    (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

  7. #7
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    1

    Default Re: Multileader lisp help (mtext problem)

    Quote Originally Posted by FRAMEDNLV View Post
    I have been using this routine:
    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 )
    )
    (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).

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

    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.

  8. #8
    Member
    Join Date
    2005-07
    Location
    Rapid City, SD
    Posts
    9
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    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?

  9. #9
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    Quote Originally Posted by robinsonmd View Post
    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

  10. #10
    Woo! Hoo! my 1st post
    Join Date
    2010-07
    Posts
    1
    Login to Give a bone
    0

    Default Re: Multileader lisp help (mtext problem)

    (defun C:MTT()
    (COMMAND "-LAYER" "S""2D_TEXT" "")
    (initcommandversion 2)
    (COMMAND "mtext")
    (princ)
    )

    above code doesnt work. it sets the layer and starts the command but fails to use the in place text editor you get when start mtext via "MTEXT"

    what am i doing wrong?

Page 1 of 2 12 LastLast

Similar Threads

  1. convert mtext to multileader
    By the_mini_guy in forum AutoCAD General
    Replies: 8
    Last Post: 2018-06-14, 11:12 AM
  2. Convert MTEXT into a Multileader
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 5
    Last Post: 2014-08-27, 03:01 PM
  3. Setting up MText for Multileader?
    By greg.robson in forum ACA General
    Replies: 0
    Last Post: 2011-10-05, 10:11 PM
  4. Changing mtext with grips in annotative multileader style
    By gadjet in forum AutoCAD Annotation
    Replies: 6
    Last Post: 2010-11-17, 02:46 PM
  5. Replies: 0
    Last Post: 2009-10-06, 08:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •