标注面积时加入反应器,面积变化出现无限循环,怎么修改,在2006上可以正常使用,高版本就不可以
- (defun c:tt ()
- (setq ent (car (entsel "\n选择线")))
- (setq pt (getpoint ""))
- (setq obj_pline (vlax-ename->vla-object ent))
- (setq txt (strcat "S=" (rtos (vla-get-area obj_pline) 2 2) ))
- (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 ent_txt (entlast))
- (setq obj_txt (vlax-ename->vla-object ent_txt))
- (setq ve (List obj_pline))
- (setq reactor
- (vlr-object-reactor
- ve
- obj_txt
- '((:vlr-objectClosed . xlr_pl_mj_text))
- )
- )
- )
- ;;;;修改进入无限循环
- (defun xlr_pl_mj_text (obj obj2 vl)
- (vla-put-textstring
- (vlr-data obj2)
- (strcat "S=" (rtos (vla-get-area obj) 2 2) )
- )
- )
|