;;; 功用:將相同圖塊的z值改為絕對值
;;; 指令:RIB
(defun c:rib(/ olde edata ename ss i sslen e ent ez z)
(setq olde (car(entsel "\n請選欲重新整理的圖塊:"))
edata (entget olde)
ename (cdr(assoc 2 edata))
ss (ssget "x" (list (cons 0 "INSERT")(cons 2 ename)))
i 0
)
(if ss (setq sslen (sslength ss)))
(repeat sslen
(setq e (ssname ss i)
ent (entget e)
ez(assoc 43 ent)
z (cdr ez)
)
(setq nez (cons 43 (ABS Z)))
(setq ent (subst nez ez ent))
(entmod ent)
(setq i (1+ i))
)
)
沒有留言:
張貼留言