Sorry for the confusion everyone...I wanted to modify mtext number values...I found this routine elsewhere.
Thanks
Steve
Code:
(defun MakeX (entname)
(vlax-ename->vla-object entname)
)
(defun GetX (object prop)
(vlax-get object prop)
)
(defun PutX (object prop val)
(vlax-put object prop val)
)
Code:
(defun c:AddText (/ txt1 txt2 cnt1 ent1 pec1)
(command "_.undo" "_end")
(command "_.undo" "_group")
(vl-load-com)
(setq txt1 (getreal "\nEnter value to increase by (if decreasing, add a minus sign before). "))
(setq cnt1 0)
(if txt1
(progn
(if (not *pec1)
(setq *pec1 3)
)
(setq pec1 (getreal (strcat "\nHow many decimal places [" (itoa *pec1) "]? ")))
(if pec1
(setq *pec1 (fix pec1))
)
(setq ss (ssget '((0 . "*TEXT"))))
(while (/= cnt1 (sslength ss))
(setq ent1 (MakeX (ssname ss cnt1)))
(setq txt2 (GetX ent1 'TextString))
(MakeSureNum txt2 ent1)
(setq cnt1 (1+ cnt1))
)
)
)
(prompt "\n May get rounding-off if new decimal is less then existing decimal places!!")
(command "_.undo" "_end")
(princ)
)
;==============
Code:
(defun MakeSureNum (txt3 ent1 / cnt1 cnt2 txt4 txt5 txt6 txt7)
(setq cnt1 0
cnt2 1
)
(if (and (>= (ascii (substr txt3 1 1)) 65) (/= (ascii (substr txt3 1 1)) 32))
(while (>= (ascii (substr txt3 1 1)) 65)
(if txt4
(setq txt4 (strcat txt4 (substr txt3 1 1)))
(setq txt4 (substr txt3 1 1))
)
(setq txt3 (substr txt3 2 (strlen txt3)))
)
)
(while (= (substr txt3 1 1) " ")
(setq txt4 (strcat txt4 " "))
(setq txt3 (substr txt3 2 (strlen txt3)))
)
(if (< (ascii (substr txt3 1 1)) 65)
(while (and (<= (ascii (substr txt3 1 1)) 65) (/= (ascii (substr txt3 1 1)) 0) (/= (ascii (substr txt3 1 1)) 32))
(if txt5
(setq txt5 (strcat txt5 (substr txt3 1 1)))
(setq txt5 (substr txt3 1 1))
)
(setq txt3 (substr txt3 2 (strlen txt3)))
)
)
(setq txt5 (atof txt5))
(setq txt6 (+ txt5 txt1))
(setq txt7
(if txt4
(strcat txt4 (rtos txt6 2 *pec1) txt3)
(strcat (rtos txt6 2 *pec1) txt3)
)
)
(PutX ent1 'Textstring txt7)
)