Author Topic: Add/Subtract (M)Text Values  (Read 6242 times)

0 Members and 1 Guest are viewing this topic.

bman

  • Guest
Add/Subtract (M)Text Values
« Reply #15 on: December 29, 2004, 12:05:46 PM »
if that didn't fix it then PM me with your email address & i'll send you the file.

DanB

  • Bull Frog
  • Posts: 367
Add/Subtract (M)Text Values
« Reply #16 on: December 29, 2004, 12:47:34 PM »
bman, your code looks to be working now. Even better news, it does work with MTEXT! I modified one of the lines to stay more in line with the precision settings we need (2 decimal places). This should work great for what we need. Thanks for sharing.

DanB

Anonymous

  • Guest
Add/Subtract (M)Text Values
« Reply #17 on: December 29, 2004, 01:13:54 PM »
not my code...but glad to help anyway

Adesu

  • Guest
Re: Add/Subtract (M)Text Values
« Reply #18 on: December 30, 2004, 10:35:23 PM »
Hi Dan,you can try my code

; rn is stand for revised number
;       Design by Ade Suharna <mteybid@yuasabattery.co.id>
;       31 December 2004
;       Program no. 152/12/2004
;       Edit by
(defun c:rn (/ e ent info1 opt prec num nnum ed)
  (while
    (setq e (entsel "\nCLICK NUMBER FOR EDIT:"))
    (setq en (entget (car e)))
    (setq info1 (atof (cdr (assoc 1 en))))
    (setq opt (atof (getstring T "\nENTER NEW NUMBER TO INSERT IT: ")))
    (setq prec (fix (atof (getstring T "\nENTER VALUE FOR PRECICION: "))))
    (setq num (+ info1 opt))
    (setq nnum (rtos num 2 prec))
    (setq ed (subst (cons 1 nnum)(assoc 1 en) en))
    (entmod ed)
    )
  (princ)
  )