Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NUMBER GENERATION

Status
Not open for further replies.

Graeme38

Electrical
Apr 30, 2002
27
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.
 
Replies continue below

Recommended for you

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
 
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
 
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 &quot;\n Start from <&quot;)
(princ (rtos *nncounter* 2 0))
(princ &quot;> : &quot;)
(setq n (getint))
(if (numberp n)
(setq *nncounter* n)
)
)
)
(while (setq e (entsel))
(command &quot;._UNDO&quot; &quot;G&quot;)
(setq elist (entget (car e)))
(setq elist
(subst (cons 1 (itoa *nncounter*))
(assoc 1 elist) elist)
)
(entmod elist)
(command &quot;._UNDO&quot; &quot;E&quot;)
(setq *nncounter* (1+ *nncounter*))
)
(princ)
)


Regards,
Farzad
 
Dear Farzad/Adrian,

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

Regards,

Graeme
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor