Leader utility

Discussion in 'AutoCAD' started by Chip Harper, Jun 21, 2004.

  1. Chip Harper

    Chip Harper Guest

    Got a call from a friend for what I thought would be a simple request but
    maybe not.
    I want to get the current layer, change to "Text" layer, run the qleader
    command
    and return back to the current layer.

    When I tested this AutoCAD studders on the Mtext portion ....Is there anyway
    to do
    this without capturing the text first then running the qleader command?

    (defun c:SLE ()
    (setq CLN (getvar "clayer"))
    (command "-layer" "make" "TEXT" "")
    (command "qleader")
    (while (> (getvar "cmdactive") 0) (command pause))
    (setvar "clayer" CLN)
    )
     
    Chip Harper, Jun 21, 2004
    #1
  2. Chip Harper

    Tim Guest

    Do you need the mtext option or do you just need the qleader?
    If just the qleader I have a routine for that.

    Tim W.
     
    Tim, Jun 21, 2004
    #2
  3. Chip,

    Search this ng, it has been covered several times in the past (try
    TextEval).

    --
    R. Robert Bell


    Got a call from a friend for what I thought would be a simple request but
    maybe not.
    I want to get the current layer, change to "Text" layer, run the qleader
    command
    and return back to the current layer.

    When I tested this AutoCAD studders on the Mtext portion ....Is there anyway
    to do
    this without capturing the text first then running the qleader command?

    (defun c:SLE ()
    (setq CLN (getvar "clayer"))
    (command "-layer" "make" "TEXT" "")
    (command "qleader")
    (while (> (getvar "cmdactive") 0) (command pause))
    (setvar "clayer" CLN)
    )
     
    R. Robert Bell, Jun 21, 2004
    #3
  4. Chip Harper

    Chip Harper Guest

    Yep, I'm wanting to use the mtext option with the leader.
     
    Chip Harper, Jun 21, 2004
    #4
  5. Chip Harper

    Chip Harper Guest

    Thanks Robert, I was searching "leader" and "layer" but wasn't finding
    anything relevant. :)
     
    Chip Harper, Jun 21, 2004
    #5
  6. So you got some good posts now?

    --
    R. Robert Bell


    Thanks Robert, I was searching "leader" and "layer" but wasn't finding
    anything relevant. :)
     
    R. Robert Bell, Jun 21, 2004
    #6
  7. Chip Harper

    Chip Harper Guest

    Oh, yeah, first one out of the box had what I needed. Thanks again. :)

    Here's the code if anyone else wants it.

    (defun c:sle ( / CLN )

    (defun cmdWait ( )
    (while (= (logand (getvar "cmdactive") 1) 1)
    (command pause)
    (princ)
    )
    )

    (setq CLN (getvar "clayer"))
    (command "-layer" "make" "TEXT" "")
    (setvar "texteval" 1)
    (command "qleader")
    (cmdWait)
    (setvar "clayer" CLN)
    (princ)
    )
     
    Chip Harper, Jun 21, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.