Good morning
I m a reeeal LISP begginer. And I want to ask for a little help. I think it is very simple for such lisp masters like you;_)
Below is a Height ordinate lisp. My problem: if there is for exapmle 19.40 meters above 0.00 this lisp shows 19.4.....but i need 19.40. As i sad it isnt big problem but i will be very gratefull for help. Thank you very much:)
Here is the lisp: "Kota" is a name of block with graphic and text.
; ========================= Update KOTA - Advance*
; edycja atrybutu w bloku KOTA
(defun c:uk ()
(prompt "\nCommand: Kota - Advance*")
(princ "\n ")
(if (null kotap) (progn
(setq kotap (getpoint "\nWskaz Punkt:"))
)
(progn
(princ "\nWskaz Punkt <")
(princ kotap)
(setq kotap1 (getpoint ">: "))
(if kotap1 (setq kotap kotap1))
))
(princ "\nCommand: Kota - Advance*")
(princ "\n\nPunkt bazowy: ")
(princ (cadr kotap))
(setq ob (ssget '((2 . "KOTA"))))
(setq nr 0)
(repeat (sslength ob)
(setq ss (entupd (ssname ob nr)))
(setq p1 (cdr (assoc 10 (entget ss))))
(setq pow (- (cadr p1) (cadr kotap)))
(setq pow (/ pow 100))
(setq sss ss)
(setq ss (entnext ss))
(setq text "%%p0.000")
(if (> pow 0) (setq text (strcat "+" (rtos pow 2 3))))
(if (< pow 0) (setq text (rtos pow 2 3)))
(setq ss (subst (cons 1 text) (assoc 1 (entget ss)) (entget ss)))
(entmod ss)
(entupd sss)
(setq nr (+ nr 1))
)
)
Thank you for help.
P.S. Sorry for my english...