Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: LEADER. LISP

  1. #1
    Active Member
    Join Date
    2012-07
    Posts
    56
    Login to Give a bone
    0

    Lightbulb LEADER. LISP

    Hey, guys.
    I'd like to put prefix in this routine. Anybody Could help me please?
    e.g. BLS 1, BLS 2 ...
    Code:
    (defun C:ld  (/ num osm pt)
      (setq osm (getvar "osmode"))
      (setvar "osmode" 0)
      (setvar "cmdecho" 0)
      (setq num (getint "\nEnter an initial number: "))
      (while
        (setq pt (getpoint
             "\nSpecify leader start point: (or hit ENTER to Exit) "))
         (command "._leader" pt pause "" (itoa num) "")
         (setq num (1+ num)))
      (setvar "cmdecho" 1)
      (setvar "osmode" osm)
      (princ)
      )
    (princ "\nStart command with LD")
    (princ)
    Kind Regards
    Last edited by rkmcswain; 2012-07-31 at 09:33 PM. Reason: added [CODE] tags

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    Take a look at the adds of this line to yours .

    Code:
     (command "._leader" pt pause "" (strcat "Example :" (itoa num)) "")

  3. #3
    Active Member
    Join Date
    2012-07
    Posts
    56
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    Does anyone have a leader lisp that will automatically increment numbers they would be willing to share?

    Best
    Regards

  4. #4
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    Quote Originally Posted by fabricio_camargo84151122 View Post
    Does anyone have a leader lisp that will automatically increment numbers they would be willing to share?

    Best
    Regards
    But your first code do incrementing the number that being inserted by the user , Isn't it ?

  5. #5
    Active Member
    Join Date
    2012-07
    Posts
    56
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    Yes, but I wanna to put a particular code as a prefix and increment numbers.
    e.g If put BLD as prefix and start the increment number in 2, the result is BLD 2, BLD 3 ...
    But if I want to use BLS as a prefix??

    Any ideas??
    Thanks

  6. #6
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    My first reply does what you want , did you check it out ?
    Just change the word example : to the one you want

  7. #7
    Active Member
    Join Date
    2012-07
    Posts
    56
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    It's works!
    I though that had other way or other lisp.
    Because I have one lisp and I'd like this will be like that.
    e.g. Command: NUM

    Type prefix: <>: BLD

    Type suffix: <>: 1

    Enter start number <1>:

    Thanks.
    Attached Files Attached Files

  8. #8
    Active Member
    Join Date
    2012-07
    Posts
    56
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    It's works!
    I though that had other way or other lisp.
    e.g.
    Command: ld
    Type prefix: <>: BLD

    Type suffix: <>: 1

    Enter start number <1>:

    Thanks.

  9. #9
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    Things like this .. .. ?

    Code:
    (defun C:ld (/ osm pt prf suf)
      (vl-load-com)
      (defun *error* (msg)
        (if	osm
          (progn (setvar "osmode" osm) (setvar "cmdecho" 1))
        )
        (or	(wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
    	(princ (strcat "\n** Error: " msg " **"))
        )
        (princ)
      )
      (if (not num)
        (setq num 1)
      )
      (setq osm (getvar "osmode"))
      (setvar "osmode" 0)
      (setvar "cmdecho" 0)
      (if (and (/= (setq prf (getstring t "\n Type prefix : ")) "")
    	   (/= (setq suf (getstring t "\n Type suffix : ")) "")
    	   (setq num (cond ((getint (strcat "\n Enter an initial number < "
    					    (itoa num)
    					    " > : "
    				    )
    			    )
    			   )
    			   (t num)
    		     )
    	   )
          )
        (while
          (setq
    	pt (getpoint
    	     "\nSpecify leader start point: (or hit ENTER to Exit) :"
    	   )
          )
           (command	"._leader" "_non"
    		pt
    		pause
    		""
    		(strcat prf " " (itoa num) " " suf)
    		""
           )
           (setq num (1+ num))
        )
      )
      (setvar "cmdecho" 1)
      (setvar "osmode" osm)
      (princ)
    )
    (princ "\nStart command with LD")
    (princ)

  10. #10
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: LEADER. LISP

    The Express Tool TCOUNT does that and more. Give it a start number and increment with options to prefix, suffix, overwrite, or find&replace. It even has sorting options.

Page 1 of 2 12 LastLast

Similar Threads

  1. Leader lisp
    By arussell2003385516 in forum AutoLISP
    Replies: 1
    Last Post: 2013-07-22, 08:41 AM
  2. Leader lisp help
    By jdcincy in forum AutoLISP
    Replies: 8
    Last Post: 2012-03-09, 08:06 PM
  3. BCount Leader LISP
    By jmarck in forum AutoLISP
    Replies: 15
    Last Post: 2010-08-06, 01:50 PM
  4. Replies: 4
    Last Post: 2006-09-15, 08:04 PM
  5. Leader Lisp With Tag
    By BCrouse in forum AutoLISP
    Replies: 9
    Last Post: 2005-10-31, 04:23 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
  •