 - (setq ref (car (entsel))) ;;;选择图块引用
- (setq refobj (vlax-ename->vla-object ref))
- (vla-get-HasAttributes refobj) ;;;值为:vlax-true,表示具有属性
- (setq atts (vla-GetAttributes refobj)) ;;;获取稍有属性
- (setq atts (VLAX-SAFEARRAY->LIST (VLAX-VARIANT-VALUE atts)))
- (setq atts (mapcar '(lambda(x)
- (cons (vla-get-TagString x) x))
- atts
- )
- )
- (vla-get-TextString (cdr (assoc "图样名称" atts))) ;;;"图样名称"的属性值
- (vla-get-TextString (cdr (assoc "图样代号" atts))) ;;;"图样代号"的属性值
|