Qleader

Discussion in 'AutoCAD' started by ChrisW, May 21, 2004.

  1. ChrisW

    ChrisW Guest

    How do i use lisp or vlisp to draw a leader from two specified points? I
    have been trying this but it isn't working.

    (command "qleader" pt1 pt2)
     
    ChrisW, May 21, 2004
    #1
  2. ChrisW

    Tim Guest

    Heres 1 I wrote to simplfy the qleader command with the added bonus that it
    goes on the correct layer

    ; Ldr.lsp (c) 2001 Tim Wilson
    ; Similar to the Quick Leader but without the text prompts

    (defun c:lk (/ lpt1 lpt2 lpt3)
    (setq #OSM (getvar "osmode"))
    (setq #OTM (getvar "orthomode"))
    (setq #CLE (getvar "clayer"))
    (setvar "OSMODE" 0)
    (setvar "orthomode" 0)
    (IF (NULL (tblsearch "layer" "Text"))
    (command "layer" "m" "Text" "c" "2" "" "")
    (command "layer" "s" "Text" "" "")
    );end if
    (setq lpt1 (getpoint "\nPick Start Point..: "))
    (setq lpt2 (getpoint lpt1 "\nPick Next Point..: "))
    (setvar "ORTHOMODE" 1)
    (setq lpt3 (getpoint lpt2 "\nPick End Point..: "))
    (if
    (null lpt3)
    (command "leader" lpt1 lpt2 "a" "" "n")
    (command "leader" lpt1 lpt2 lpt3 "a" "" "n")
    );end if
    (setvar "osmode" #osm)
    (setvar "orthomode" #otm)
    (setvar "clayer" #CLE)
    (princ)
    );end defun
    (PRINC)


    Tim Wilson
     
    Tim, May 21, 2004
    #2
  3. ChrisW

    ChrisW Guest

    Thanks for the help everyone.
     
    ChrisW, May 21, 2004
    #3
  4. ChrisW

    Jamie Duncan Guest

    Chris,

    in the future, do the command from the command line - i.e. -insert for
    insert a block for example, and carefully note the options and questions.
    Then when you use the command in lisp, just simply set the options and
    answer the questions the same way.


    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, May 22, 2004
    #4
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.