PDA

View Full Version : Subtract values


windowsxp5
11-10-2004, 02:51 PM
Dear FrndZ.
I am looking for a lisp that can Add or subtract values from two text numeric entities
And place in to user defined point.(Attaching image. Select (1) and (2) subtracted answer (3) )
Anyone have that lisp.
Thanks in Advance..

windowsxp5
12-10-2004, 05:32 AM
(defun c:sbtxt ( / Txt1 Txt2 Txt3 Pkt1 )
(setq Txt1 (entsel "Select first text : " ) )
(setq Txt2 (entsel "Select second text : " ) )
(setq Txt3
(strcat
"("
(rtos (- (atof (cdr (assoc 1 (entget (car Txt1 ))))) (atof (cdr (assoc 1 (entget (car Txt2 ))))) ) 2 2 )
")"
)
)
(setq Pkt1 (getpoint "Where to place difference ? : ") )
(command "._text" Pkt1 "" Txt3 "" )
(princ)
)