PDA

View Full Version : Add counter to existing command



OCD
2009-12-18, 03:33 AM
Is there a way to add an auto counter to an existing command? The command I have does the following:
CommandX
select object
enter number
then repeats select object and enter number until you exit command.

I would like to use the existing command, but enter a number and then the lisp to auto count by 1 from there.
lisp
CommandX
select object
enter number "n"
select object
n+1
...

ccowgill
2009-12-18, 12:45 PM
Is there a way to add an auto counter to an existing command? The command I have does the following:
CommandX
select object
enter number
then repeats select object and enter number until you exit command.

I would like to use the existing command, but enter a number and then the lisp to auto count by 1 from there.
lisp
CommandX
select object
enter number "n"
select object
n+1
...
you would have to undefine the original command, then create a lisp that redefines it, you could use repeat and input the user specified number of times to repeat. If you are trying to increment some number by one, use:


(setq n (1+ n))

within the repeat or a while loop.

irneb
2009-12-18, 05:25 PM
Are you looking for something like an incrementer? If so try the one in this thread: http://forums.augi.com/showthread.php?t=97069