急,刚用(entmod(subst ....))更新过的表,再assoc引用结果没更新?
程序贴一段,看看
贴了,帮忙看看..
本帖最后由 作者 于 2002-8-20 20:02:15 编辑;;; funtion 2
(defun th()
(setq txtent(car (entsel "\n 选择标高文字: ")))
(setq txtdata(entget txtent))
(setq txtid(cdr (assoc 10 txtdata)))
(setq txth(cdr (assoc 40 txtdata)))
(setq txtm(cdr (assoc 1 txtdata)))
(setq txt(cons 1 (strcat "(" "H" txtm ")")))
(entmod (subst txt (assoc 1 txtdata) txtdata));;;就是这段更新了txtdata表后,textbox这个表,类容是更新前的
(setq txtidx(car txtid)
txtidy(cadr txtid)
)
(setq tx(+ (caadr (textbox txtdata)) txtidx))
(setq ty(+ txtidy (/ txth 2)))
(setq txy(strcat (rtos tx 2 2) "," (rtos ty 2 2)))
)
;;; end funtion 2
因为实体更新后,变量txtdate并没有更新。
(entmod (subst txt (assoc 1 txtdata) txtdata))这句改为:
(entmod (setq txtdate (subst txt (assoc 1 txtdata) txtdata)))
因为实体更新后,变量txtdate并没有更新。
看看...
看看..;;; funtion 2
(defun TH ()
(setq TXTENT (car (entsel "\n择标高文字: ")))
(setq TXTDATA (entget TXTENT))
(setq TXTID (cdr (assoc 10 TXTDATA)))
(setq TXTH (cdr (assoc 40 TXTDATA)))
(setq TXTM (cdr (assoc 1 TXTDATA)))
(setq TXT (cons 1 (strcat "(" "H" TXTM ")")))
;(entmod (subst TXT (assoc 1 TXTDATA) TXTDATA))
(entmod (setq TXTDATA (subst TXT (assoc 1 TXTDATA) TXTDATA)))
;;;就是这段更新了txtdata表后,textbox这个表,类容是更新的
(setq TXTIDX (car TXTID)
TXTIDY (cadr TXTID)
)
(setq TX (+ (caadr (textbox TXTDATA)) TXTIDX))
(setq TY (+ TXTIDY (/ TXTH 2)))
(setq TXY (strcat (rtos TX 2 2) "," (rtos TY 2 2)))
)
;;; end funtion 2
感谢龙龙和ll_j !!
ll_j 发表于 2002-8-21 08:18(entmod (subst txt (assoc 1 txtdata) txtdata))
这句改为:
(entmod (setq txtdate (subst txt (asso ...
多谢指导
页:
[1]