×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NUMBER GENERATION

NUMBER GENERATION

NUMBER GENERATION

(OP)
I am looking to be able to produce a numbering system for structured wiring voice/data outlets, such that when I produce the number on the drawing via say a data point block, the number automatically increments by one for the next block inserted.

Is there any routine for doing this?

Many thanks in anticipation.

RE: NUMBER GENERATION

Dear Graeme;

Mechanical Desktop, Solidworks and other solid modellers have this capability built in. Cadalyst magazine listed lisp routines available to do the same thing with autocad.
I think one routine was called "Bubble Sort". I know I have a copy but I am still looking through my texts trying to find it as it has been several years since I saw it. Perhaps someone else will be able to dig up a more current copy.

Regards Adrian

RE: NUMBER GENERATION

Dear Graeme;

I have written a VisualLISP program to change existing
text objects to incremental numbers.
Just copy and paste the below expressions into a text file
and save it with NN.LSP file name. Then load it into AutoCAD
using the APPLOAD command.
Enter the command "NN", enter the starting number and
at last successively select existing text objects to
change them to incremental numbers.

:)
Farzad

RE: NUMBER GENERATION

Dear Graeme;

I have written a VisualLISP program to change existing
text objects to incremental numbers.
Just copy and paste the below expressions into a text file
and save it with NN.LSP file name. Then load it into AutoCAD
using the APPLOAD command.
Enter the command "NN", enter the starting number and
at last successively select existing text objects to
change them to incremental numbers.


(defun c:nn( / e elist n )
  (if (not (numberp *nncounter*))
    (progn
      (initget 1)
      (setq *nncounter* (getint "\n   Start from : "))
    )
    (progn
      (princ "\n   Start from <")
      (princ (rtos *nncounter* 2 0))
      (princ "> : ")
      (setq n (getint))
      (if (numberp n)
    (setq *nncounter* n)
      )
    )
  )
  (while (setq e (entsel))
    (command "._UNDO" "G")
    (setq elist (entget (car e)))
    (setq elist
       (subst (cons 1 (itoa *nncounter*))
       (assoc 1 elist) elist)
    )
    (entmod elist)
    (command "._UNDO" "E")
    (setq *nncounter* (1+ *nncounter*))
  )
  (princ)
)


Regards,
Farzad

RE: NUMBER GENERATION

(OP)
Dear Farzad/Adrian,

Many thanks for all of your help. I will give it a try.

Regards,

Graeme

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources