Results 1 to 3 of 3

Thread: Auto-Numbering lisp

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    2004-09
    Posts
    4
    Login to Give a bone
    0

    Question Auto-Numbering lisp

    I'm in need of some help.
    I have a block that I need auto-numbering for.
    I've tried several different routines even one that I
    wrote and can't seem to get it to do want I want it to.
    It's a circle divided in two the upper number will be the mile
    the lower number will be the pole number.
    Can anyone help me please.
    Lloyd.Godsey@aps.com

  2. #2
    Woo! Hoo! my 1st post
    Join Date
    2006-10
    Posts
    1
    Login to Give a bone
    0

    Default Re: Auto-Numbering lisp

    Quote Originally Posted by ldgodsey View Post
    I'm in need of some help.
    I have a block that I need auto-numbering for.
    I've tried several different routines even one that I
    wrote and can't seem to get it to do want I want it to.
    It's a circle divided in two the upper number will be the mile
    the lower number will be the pole number.
    Can anyone help me please.
    Lloyd.Godsey@aps.com
    This routine just needs a block called "pole" with 2 attributes, mile and pole, defined in that order. It uses 2 global variables so your numbering will pick up where you left off if you exit the command. If you enter a keyword, "M" or "P", you can adjust the current number. There is no error checking included.

    Code:
    (defun c:PlacePole ( / pnt )
      (setq PlacePole$mile 1
            PlacePole$pole 1
      )
    
      (while (progn
             (initget "Mile Pole")
             (setq pnt
              (getpoint
                (strcat "\nMile "
                (itoa PlacePole$mile) "/Pole: "
                (itoa PlacePole$pole) ":"))
             )
        )
        (cond
          ((= pnt "Mile")
            (setq PlacePole$mile (getint "\nEnter new mile number: "))
            (setq PlacePole$pole 1)
          )
          ((= pnt "Pole")
            (setq PlacePole$pole (getint "\nEnter new pole number: "))
          )
          ((= (type pnt) 'LIST)
            (setvar "ATTDIA" 0)
            (command ".INSERT" "POLE" pnt 40 "" ""
              (itoa PlacePole$mile) (itoa PlacePole$pole))
            (setvar "ATTDIA" 1)
            (setq PlacePole$pole (1+ PlacePole$pole))
          )
        )
      )
    )
    - Frank

  3. #3
    Member
    Join Date
    2004-09
    Posts
    4
    Login to Give a bone
    0

    Smile Re: Auto-Numbering lisp

    THANK YOU VERY MUCH FOR YOUR HELP.
    LLOYD

Similar Threads

  1. 2013: Auto-numbering
    By fjtdogeno in forum Revit Architecture - General
    Replies: 2
    Last Post: 2012-08-22, 04:03 PM
  2. Auto Numbering
    By sandeep_koodal in forum AutoCAD Tips & Tricks
    Replies: 9
    Last Post: 2012-05-16, 03:25 PM
  3. Auto Numbering
    By windowsxp5 in forum AutoLISP
    Replies: 3
    Last Post: 2011-11-11, 10:59 AM
  4. Auto Numbering Blocks
    By kwest in forum AutoLISP
    Replies: 4
    Last Post: 2009-02-25, 10:40 PM
  5. Auto Numbering tools Lt
    By neilcheshire in forum AutoCAD LT - General
    Replies: 0
    Last Post: 2008-03-05, 12:49 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
  •