0 Members and 1 Guest are viewing this topic.
(defun c:tcount (/ cmd t1 t2 t3 index txt1 txt2 txt3 txt4 cs1 cs2) (setq cmd (getvar "cmdecho")) (setvar "cmdecho" 0) (prompt "\nSelect numbers in order to change: ") (setq t1 (ssget));;gets user input on selection order (setq t2 (getint "\nInsert first number: "));;user inserts what the first selectd number needs to be (setq t3 (getint "\nNumber increments: "));;this tells the program how many to add to each number (setq index 0) (repeat (sslength t1);;this repeats however many selections were made (setq txt1 (entget (ssname t1 index)));;start check selection (setq cs1 (cdr (assoc 1 txt1))) (setq cs2 (substr cs1 (strlen cs1) (strlen cs1)));;find out what the last string is (if (= cs2 ".");;if there is a period, run this section (progn (setq txt2 (assoc 1 txt1));;extract out the association of 1 from the list (setq txt3 (cons 1 (strcat (rtos t2 2 0) ".")));;construct a new 1 for the list adding the period at the end (setq txt4 (subst txt3 txt2 txt1));;substitute the constructed for the associated 1 (entmod txt4);;modify the list (setq t2 (+ t2 t3));;add increment to number );;end progn );;end if (if (/= cs2 ".");;if there is no period, run this section (progn (setq txt2 (assoc 1 txt1));;extract out the association of 1 from the list (setq txt3 (cons 1 (rtos t2 2 0)));;construct a new 1 for the list (setq txt4 (subst txt3 txt2 txt1));;substitute the constructed for the associated 1 (entmod txt4);;modify the list (setq t2 (+ t2 t3));;add increment to number );;end progn );;end if (setq index (+ index 1));;go to the next seleciton );;end repeat (setvar "cmdecho" cmd);;reset variable back to original state (princ);;clear command line);;end defun tcount
Alright, I don't have that in my express menu, but let's take this in another direction...what about an automatic table/schedule creator? I know I could upgrade to ADT, but what about in AutoCAD 2000i?