VLA-OBJECT-布局不将VLA-OBJECT-块作为子对象。。。
尝试将最后一段改为:
- (vlax-for obj (vla-get-blocks adoc)
- (if (and (= "AcDbBlockReference" (vla-get-objectname obj))
- (member (vla-get-effectivename obj) Nombloc)
- (= :vlax-true (vla-get-hasattributes obj))
- )
- (progn
- (setq atts (vlax-invoke obj 'getattributes))
- (foreach x atts
- (if (= Tag (vla-get-tagstring x))
- (vla-put-textstring x Text)
- )
- )
- )
- )
- )
HTH
[编辑]:刚刚选中-你可能想到了VLA-OBJECT-ActiveLayout,所以…:
- (vlax-for lt (vla-get-[color=red]activelayout[/color] adoc)
- (vlax-for obj (vla-get-block lt)
- (if (and (= "AcDbBlockReference" (vla-get-objectname obj))
- (member (vla-get-effectivename obj) Nombloc)
- (= :vlax-true (vla-get-hasattributes obj))
- )
- (progn
- (setq atts (vlax-invoke obj 'getattributes))
- (foreach x atts
- (if (= Tag (vla-get-tagstring x))
- (vla-put-textstring x Text)
- )
- )
- )
- )
- )
- )
|