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.
Is there any routine for doing this?
Many thanks in anticipation.





RE: NUMBER GENERATION
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
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
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
Many thanks for all of your help. I will give it a try.
Regards,
Graeme