(defun c:tl( / jj i j ent ena ent1 ss) (setq ss (ssget)) (setq i -1) (setq j (* (sslength ss) 2)) (repeat (sslength ss) (setq ent (entget (ssname ss (setq i (1+ i)))));取块的ent data (setq ena (cdr (assoc '-2 (tblsearch "block" (cdr(assoc '2 ent))))));取块子元素的名称 (while (setq ena (entnext ena));循环 (if (= (cdr (assoc '8 (setq ent1 (entget ena)))) "roof truss")(progn (setq opts (cdr (assoc '10 ent1))) (setq opte (cdr (assoc '11 ent1))) (command "ucs" "ob" (cdr(assoc '-1 ent)));坐标系转为块插入的坐标 (setq npts (trans opts 1 0)) (setq npts (list (car npts)(cadr npts)(+ (caddr npts) 50))) (setq npts (trans npts 0 1)) (setq ent1 (subst (cons 10 npts) (assoc 10 ent1) ent1)) (setq npte (trans opte 1 0)) (setq npte (list (car npte)(cadr npte)(+ (caddr npte) 50))) (setq npte (trans npte 0 1)) (setq ent1 (subst (cons 11 npte) (cons 11 opte) ent1));这个ent1 的data已经是我想要的结果了 (entmod ent1) (entmod ent);entmod后,发现块里的数据没有任何改变???这是为什么? (command "ucs" "w") ) ) ) ) ) 大侠们看看是哪里出问题了?不胜感激!! entmod后完全没有反应。。。-0- 见鬼了, 我只是想把图中的紫色线,图层为roof truss的提高50mm 但是死活改不了。。这是为什么??? |