This lisp routine worked fine until I copied and pasted it within the same folder. When I renamed it the original file name (ie minus 'copy of..') it stopped. The routine adds a number to the number only text.
I dont think it's a problem with the code but I have included it anyway. Does anyone have any ideas ? I'm using 2006.
;* DXF takes an integer dxf code and an entity data list.
;* It returns the data element of the association pair.
(defun dxf (code elist)
(cdr (assoc code elist))
)
;* ADD - adds/subtracts a number to/from selected figures. Requires DXF function.
(defun c:add ()
(prompt "\nSelect numbers to amend...")
(if (setq ss1 (ssget))
(progn
(setq amt (getreal "\nEnter No. to add: ")
count 0
emax (sslength ss1)
)
(prompt "\nSearching ")
(while (< count emax)
(setq en (ssname ss1 count)
ed (entget en)
et (dxf 0 ed)
)
(princ et)
(prompt ".")
(cond
((= et "mTEXT")
(setq num (atof (cdr (assoc 1 ed))))
(setq old (assoc 1 ed))
(setq num (+ num amt))
(setq nums (cons 1 (rtos num)))
(setq ed (subst nums old ed))
(entmod ed)
)
)
(setq count (1+ count))
)
)
)
(setq ss1 nil)
)
(princ)