Results 1 to 4 of 4

Thread: mleader text issue in LSP

  1. #1
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default mleader text issue in LSP

    See attached LSP file. The issue I am having is that when I run the lisp, I go to enter the text for the leader and it shows up in the command line rather than next to the leader. Because of that, when I hit the space bar it ends the text and completes the command. I would like to enter my text next to the leader I just inserted. Any ideas?

    The whole reason for creating this lisp was to put the layer back to what it was instead of making the leader layer current.

    P.S. The LINES.dwg file has the "SMALLARROW" leader style in it that will need to be loaded into the drawing use to test the leader.
    Attached Files Attached Files

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: mleader text issue in LSP

    Add: (initcommandversion) before you start the MLeader command.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default Re: mleader text issue in LSP

    Thanks Robert, that did the trick. Below is the final version.
    Code:
    (defun c:MECHLEADER ()
      (setvar "cmdecho" 0)
      (setq oldlay (getvar "clayer"))
      (command "-LAYER" "M" "MENOTE" "C" "7" "" "")
      (command "CMLEADERSTYLE" "SMALLARROW")
      (initcommandversion)
      (command "MLEADER")
      (setvar "clayer" oldlay)
      (setvar "cmdecho" 1)
    )
    Last edited by RobertB; 2010-03-10 at 11:35 PM.

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Exclamation Re: mleader text issue in LSP

    Quote Originally Posted by CAD Brad View Post
    Thanks Robert, that did the trick. Below is the final version.
    Code:
    (defun c:MECHLEADER ()
      (setvar "cmdecho" 0)
      (setq oldlay (getvar "clayer"))
      (command "-LAYER" "M" "MENOTE" "C" "7" "" "")
      (command "CMLEADERSTYLE" "SMALLARROW")
      (initcommandversion)
      (command "MLEADER")
      (setvar "clayer" oldlay)
      (setvar "cmdecho" 1)
    )
    I hope that isn't the final version. The way the code is written, the original layer will be restored before the MLeader is drawn. Suggest the following revision:
    Code:
      (initcommandversion)
      (setvar 'CmdEcho 1)
      (command "MLEADER")
      (while (> (getvar 'CmdActive) 0) (command pause))
      (setvar "clayer" oldlay)
      (princ)
    )
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

Similar Threads

  1. MLEADER Text Style
    By Wish List System in forum AutoCAD Wish List
    Replies: 6
    Last Post: 2019-05-01, 04:15 PM
  2. Mleader Text colour
    By feargt in forum AutoLISP
    Replies: 4
    Last Post: 2014-03-10, 02:24 PM
  3. I can't see the text for an mleader
    By GreyHippo in forum AutoCAD General
    Replies: 2
    Last Post: 2009-07-29, 06:25 PM
  4. MLeader text frame
    By lpseifert in forum AutoCAD Annotation
    Replies: 3
    Last Post: 2008-07-31, 02:49 AM
  5. MLEADER LANDING ISSUE
    By dbrownson in forum AutoCAD General
    Replies: 4
    Last Post: 2008-07-07, 06:42 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
  •