Does anyone have a routine that will prompt user to pick text entities and accumulate their value?
(defun c:addtext ( / ss cnt txtval ename) (setq ss (ssget '((0 . "TEXT"))) cnt 0 txtval 0 ) (if ss (repeat (sslength ss) (setq ename (ssname ss cnt) txtval (+ txtval (atof (cdr (assoc 1 (entget ename))))) cnt (1+ cnt) ) );end repeat ) (princ (strcat "\nTotal value = " (rtos txtval))) (princ) )
I assume you're talking about text strings representing numerical values -- I don't have one, but look into the (atof) function, which would be the main ingredient. (But it wouldn't work with fractions.)