Results 1 to 5 of 5

Thread: Does anyone have a multiple leader LISP routine

  1. #1
    Member
    Join Date
    2004-08
    Posts
    15
    Login to Give a bone
    0

    Question Does anyone have a multiple leader LISP routine

    Looking for a lisp routine that will add multiple leader lines to a single line of text. Any Ideas?

  2. #2
    Active Member
    Join Date
    2003-11
    Location
    YUL
    Posts
    75
    Login to Give a bone
    0

    Default Re: Does anyone have a multiple leader LISP routine

    I use this:

    Code:
    (defun c:ml (/ osn pl ip )
      (setvar "cmdecho" 0)
      (setq osn (getvar "osmode"))
      (setq pl (getpoint "\n Connected to :"))
      (setvar "osmode" 0)
      (setq ip (getpoint pl "\n Arrow :"))
      (while ip
        (if ip (command "leader" ip pl "" "" "n" ^c^c))
        (setq ip (getpoint pl "\n Next arrow :"))
      )
      (setvar "osmode" osn)
      (princ)
    )

  3. #3
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: Does anyone have a multiple leader LISP routine

    One is a pointer (arrow and line only) the other is a leader.

    I stripped out the basics of what i use. hopefully, they still work.

    Code:
    ;;; BEGINNING VERSION 1.8
    (DEFUN c:newpointer
    	   (/ |clayer| |cmdecho| |olderror| |orthomode| |polarmode|)
      (COMMAND "undo" "begin")
      (SETQ |orthomode| (GETVAR "orthomode"))
      (SETQ |polarmode| (GETVAR "polarmode"))
      (SETVAR "orthomode" 0)
      (SETVAR "polarmode" 0)
      (COMMAND "leader" pause pause "" "" "n")
      (SETVAR "orthomode" |orthomode|)
      (SETVAR "polarmode" |polarmode|)
      (COMMAND "undo" "end")
      (PRINC)
    ) ;_ end of DEFUN
    
    ;;; BEGINNING VERSION 1.9
    (DEFUN c:newleadonly (/		   |ang1|	|ang|
    			  |autosnap|   |clayer|	|cmdecho|
    			  |dimexe1|	   |dimexe|	|dimgap1|
    			  |dimgap|	   |dimscale|	|dist|
    			  |olderror|   |orthomode|	|osmode|
    			  |polarmode|  |pt1|	|pt2|
    			  |pt3|	   |pt4|
    			 )
      (COMMAND "undo" "begin")
      (SETQ |cmdecho| (GETVAR "cmdecho"))
      (SETQ |dimexe| (GETVAR "dimexe"))
      (SETQ |dimgap| (GETVAR "dimgap"))
      (SETQ |dimscale| (GETVAR "dimscale"))
      (SETQ |orthomode| (GETVAR "orthomode"))
      (SETQ |osmode| (GETVAR "osmode"))
      (SETQ |polarmode| (GETVAR "polarmode"))
      (SETVAR "cmdecho" 1)
      (SETVAR "orthomode" 0)
      (SETVAR "polarmode" 0)
      (SETVAR "osmode" 0)
      (SETQ |pt1| (GETPOINT "\nSpecify leader start point: "))
    ;;;  (setvar "osmode" 64)
      (SETQ |pt2| (GETPOINT |pt1| "\nSelect insert point of text: "))
    ;;;  (setvar "osmode" 0)
      (SETQ |dimgap1| (* |dimgap| |dimscale|))
      (SETQ |dimexe1| (* |dimexe| |dimscale|))
      (SETQ |dist| (+ |dimexe1| |dimgap1|))
      (SETQ |ang| (ANGLE |pt2| |pt1|))
      (PROGN (IF (< |ang| (/ PI 2))
    	   (SETQ |ang1| 0.0)
    	   (IF (> |ang| (* (/ PI 2) 3))
    		 (SETQ |ang1| 0.0)
    		 (SETQ |ang1| PI)
    	   ) ;_ end of IF
    	 ) ;_ end of IF
      ) ;_ end of PROGN
      (SETQ |pt4| (POLAR |pt2| |ang1| |dimgap1|))
      (SETQ |pt3| (POLAR |pt2| |ang1| |dist|))
      (COMMAND "leader" |pt1| |pt3| |pt4| "" "" "n")
      (SETVAR "cmdecho" |cmdecho|)
      (SETVAR "orthomode" |orthomode|)
      (SETVAR "osmode" |osmode|)
      (SETVAR "polarmode" |polarmode|)
      (COMMAND "undo" "end")
      (PRINC)
    ) ;_ end of DEFUN

  4. #4
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    0

    Default Re: Does anyone have a multiple leader LISP routine

    Quote Originally Posted by dluzius
    Looking for a lisp routine that will add multiple leader lines to a single line of text. Any Ideas?
    ?? are you using text or mtext with you leader

    If using mtext see no need for list just
    1. Add a leader using the leader command
    2. copy the leader (only the leader not the mtext)
    3. use the QLATTACH command to attach the leader you copy to the mtext
    4. repeat step 2 and 3 number of times needed
    a button on a tool bar to do step 2 and 3 my be of help.
    Code:
     ^C^C_copy;\\\\QLATTACH;L;\
    Last edited by jwanstaett; 2006-09-15 at 03:14 PM.

  5. #5
    Member
    Join Date
    2006-02
    Location
    SLC
    Posts
    35
    Login to Give a bone
    0

    Default Re: Does anyone have a multiple leader LISP routine

    We use a LISP routine that uses mtext and then depending the size of the original box it place makes as many leaders as you want until you exit the command.
    See pic.
    If this is what you would like I could post it.
    Brian
    Attached Images Attached Images

Similar Threads

  1. 2013: LISP Routine for adding Coords / Leader / Northing + Easting to Drawing
    By Wayne.Tappe in forum AutoCAD General
    Replies: 1
    Last Post: 2013-12-11, 02:10 PM
  2. Replies: 8
    Last Post: 2008-05-13, 03:39 PM
  3. How to run a LISP routine on multiple drawings?
    By jmoore284 in forum AutoLISP
    Replies: 3
    Last Post: 2008-05-06, 05:24 AM
  4. Creating leader with lisp routine
    By VBOYAJI in forum AutoLISP
    Replies: 4
    Last Post: 2006-12-20, 10:38 PM
  5. Replies: 1
    Last Post: 2006-07-25, 03:33 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
  •