qleader lisp

Discussion in 'AutoCAD' started by ikaage, Oct 14, 2004.

  1. ikaage

    ikaage Guest

    this lisp works fine unless you quit half-way through - at which point it will move the last created object. anyone know how to void this lisp if not carried all the way through? ideally, you could void after the creation of mtext and mtext would remain. thanks for your help.


    (defun c:Q (/ Clayer$ Cnt# DScale~ EntList@ Mid$ New@ Num#
    Old@ Pt1@ Pt2@ Pt3@ SS& Text$
    );variables
    (setvar "CMDECHO" 1)
    (princ "\nDIM Leader")
    (if (= (getvar "DIMSCALE") 0)
    (setq DScale~ 1)
    (setq DScale~ (getvar "DIMSCALE"))
    );if
    (setq Clayer$ (getvar "CLAYER"))
    (command ".LAYER" "M" "A-ANNO-NOTE" "C" "171" "" "")
    (command "COLOR" "132")
    (setq y@ (* DScale~ 0.04))
    (setq Pt5@ (list 0 y@))
    (initdia)
    (command "MTEXT" "5000,5000" "H" (* DScale~ 0.078125) "W" (* DScale~ 1.25) "")
    (setq Text$ (entlast))
    (command "ORTHOMODE" "0")
    (command "MOVE" Text$ "" "5000,5000" Pt5@)
    (command "MOVE" Text$ "" "0,0" pause)
    (setq Pt4@ (getvar "LASTPOINT"))
    (command "COLOR" "BYLAYER")
    (setq Pt1@ (getpoint"\nFrom point: "))
    (setq X1~ (car Pt4@))
    (setq X2~ (car Pt1@))
    (if (>= X2~ X1~)
    (setq Pt2@ (polar Pt4@ 0 (* DScale~ 1.575)))
    (setq Pt2@ (polar Pt4@ pi (* DScale~ 0.325)))
    );if
    (if (>= X2~ X1~)
    (setq Pt3@ (polar Pt2@ pi (* DScale~ 0.275)))
    (setq Pt3@ (polar Pt2@ 0 (* DScale~ 0.275)))
    );if
    (command "QLEADER" Pt1@ Pt2@ Pt3@ ^c)
    (command ".LAYER" "S" Clayer$ "")
    (princ)
    );defun c:Q
    ;---------------------------------------
    ; ----------------------------------------
    ;
    (princ);End of Q.lsp
     
    ikaage, Oct 14, 2004
    #1
  2. ikaage

    T.Willey Guest

    You would have to create and error function specific for your routine. You can search the NG here because the topic of error trapping has been covered alot. If you have questions still post and someone who about error trapping can answer.

    Tim
     
    T.Willey, Oct 14, 2004
    #2
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.