Array numbers, lisp?

Discussion in 'AutoCAD' started by Pekka P, Aug 10, 2005.

  1. Pekka P

    Pekka P Guest

    Hello,

    I need line of numbers starting from 1 to 50: is there a way to do this with
    array so that the numbers grow automatically and I don´t have to edit each
    one separately?

    thanks,
    P
     
    Pekka P, Aug 10, 2005
    #1
  2. There are a bunch of these around. This one seems to work:
    ------------------------------------
    ; NUMBERS.LSP

    ; Increments numbers while the user randomly places them around the screen.

    (defun C:NUMBERS (/ A B C D E)

    (setvar "CMDECHO" 0)
    (setq A (getint "\nEnter first number of series: "))
    (setq B (getint "\nEnter last number of series: "))
    (setq C (getreal "\nEnter text height: "))
    (setq D (getreal "\nText rotation <0>: "))

    (if (= D nil)
    (setq D 0)
    )

    (while (<= A B)
    (setq E (getpoint "\nLocation of number: "))
    (command "TEXT" E C D A)
    (setq A (+ A 1))
    )

    ); end of numbers
     
    Michael Bulatovich, Aug 10, 2005
    #2
  3. Pekka P

    Pekka P Guest

    Thanks!

     
    Pekka P, Aug 11, 2005
    #3
  4. Take a penny, give a penny! ; )
     
    Michael Bulatovich, Aug 11, 2005
    #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.