这个面积标注,自动更新面积的,在低版本可以用,高版本有问题,请大神们指点一下
本帖最后由 永不言弃 于 2023-12-29 17:03 编辑这个面积标注,自动更新面积的,在低版本可以用,高版本有问题,请大神们指点一下,谢谢
(defun c:tt ()
(if (setq etn_ls (entsel "\n 选择封闭线"))
(progn
(setq en1 (car etn_ls))
(setq pt (cadr etn_ls))
(setq VC (vlax-ename->vla-object en1))
(setq txt (rtos (vla-get-area VC) 2 0))
(entmake
(list (cons 0 "TEXT")
(cons 8 "MJ")
(cons 10 pt)
(cons 11 pt)
(cons 71 0)
(cons 72 1)
(cons 73 2)
(cons 1 txt)
(cons 40 1.5)
)
)
(setq en2 (entlast))
(setq EH1 (cdr (assoc 5 (entget en2))))
(setq EH_L (list EH1))
(setq VC_L (list VC))
(vlr-pers
(vlr-object-reactor
VC_L
EH_L
'((:vlr-modified . change_xlr_txtmj))
)
)
)
)
)
(defun change_xlr_txtmj(NOTIFIER-OBJECT REACTOR-OBJECT PARAMETER-LIST /)
(if (not (vlax-erased-p NOTIFIER-OBJECT))
(progn
(setq EC (vlax-vla-object->ename NOTIFIER-OBJECT))
(setq EC_L (entget EC))
(setq kj(rtos (vla-get-area NOTIFIER-OBJECT) 2 0))
(setq EH_L (vlr-data reactor-object))
(setq E1_L (vlax-ename->vla-object (handent (car EH_L))))
(vla-put-textstring E1_L kj)
)
)
)
页:
[1]