ca002의 z값을 소수점 첫번째까지 입력해 주는 리습입니다.
그런데 예를 들어 z값이 9.9961인 경우 그냥 10만 입력되어 집니다.
이런 걸 10.0까지 나오게 하려면 어딜 고쳐야 할까요? (T_T)/
(defun c:spot1000()
(ca0021del)
(ca0021write))
(defun ca0021del(/ tot num idx)
(setq idx 0)
(prompt “n SELECTING .. “)
(setq tot (ssget “X” ‘ (( 8 . “ca0021”) ( 0 . “TEXT” ))))
(setq num (sslength tot))
(repeat num
(entdel (cdr (car (entget (ssname tot idx)))))
(prompt “r ERASING .. “)
(setq idx (+ 1 idx))
)
)
(defun ca0021write(/ tot num bigo idx xlist ylist zlist ztext list ptt mv_x mv_y)
(setq idx 0)
(prompt “r SELECTING .. “)
(setq tot (ssget “X” ‘ (( 8 . “ca002”) ( 0 . “INSERT” ))))
(setq num (sslength tot))
(setq bigo (tblsearch “layer” “ca0021”))
(if (eq bigo nil)
(progn
(command “layer” “m” “ca0021” “c” “14” “”)
)
(progn
(command “layer” “s” “ca0021” “”)
)
)
(repeat num
(setq list (entget (ssname tot idx)))
(setq xlist (nth 1 (assoc 10 list)))
(setq ylist (nth 2 (assoc 10 list)))
(setq zlist (nth 3 (assoc 10 list)))
(setq ztext (rtos zlist 2 1))
(setq mv_x ( + xlist 2.0))
(setq mv_y ( – ylist 0.71))
(setq ptt (strcat (rtos mv_x) “,” (rtos mv_y) “,” (rtos zlist)))
(command “text” ptt “2.0” “0” ztext)
(prompt “r WRITING .. “)
(setq idx (+ 1 idx))
)
)