Message 1 of 18
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have lisp as below to subtract two number and replace another number, please help me check error, many thanks:
(defun c:tru()
(vl-load-com)
((setq sobitru (car (entsel "\nChon so bi tru:"))
sotru (car (entsel "\nChon so tru:\n"))
kqua (- (atof (cdr (assoc 1 (entget sobitru))))
(atof (cdr (assoc 1 (entget sotru))))))
(princ kqua))
)
(if (not ssle) (setq ssle 0))
(setq obj (vlax-ename->vla-object (car (entsel "\nChon text de ghi ket qua:")))
ssle1 (getint (strcat "\nSo so le <" (itoa ssle) ">: ")))
(if ssle1 (setq ssle ssle1))
(vla-put-TextString obj (rtos kqua 2 ssle))
(princ)
)
Solved! Go to Solution.