本帖最后由 菜卷鱼 于 2022-9-12 10:20 编辑
想做一个块属性反应器,本来是想用在动态块上,通过更改块的文字属性引发动态属性的改变
但是一用到 vla-getattributes 就报错了,所以后面的东西就整不下去了,
报错内容是;错误:Automation 错误。 对象已打开进行通知;
求指点啊!
- (defun c:ff ( )
- (setq ss(ssget '((0 . "INSERT"))))
- (setq blkReactor (vlr-object-reactor (mapcar 'vlax-ename->vla-object (sslist ss))
- "getattributes" '((:vlr-subObjModified . b_drive))))
- (prin1)
- )
- (defun b_drive (v r e )
- (setq a v)
- (setq attlist (vlax-safearray->list
- (vlax-variant-value (vla-getattributes a)))) ;;;;;;;;;;;;到这来就报错了
- (foreach att attlist
- (setq att_txt (vla-get-textstring att))
- (setq tag_text (vla-get-TagString att))
- (setq stag (cons tag_text att_txt))
- (setq attxtlist (cons stag attxtlist))
- (reverse attxtlist)
- )
- )
|