只需一步,快速开始
使用道具 举报
找了很久都没有相关思路。请帮帮忙
(defun vlex-GetAttributes (ent / blkref lst) (if (= (vla-Get-ObjectName (setq blkref (vlax-Ename->vla-Object ent))) "AcDbBlockReference") (if (vla-Get-HasAttributes blkref) (mapcar '(lambda (x) (setq lst (cons (cons (vla-Get-TagString x) (vla-Get-TextString x)) lst)) ) (vlax-safearray->list (vlax-variant-value (vla-GetAttributes blkref)) ) ); mapcar ); endif ); endif (reverse lst))
;(cdr (assoc "ScaleTAG" (vlex-GetAttributes (car (entsel)))))得到指定标记的属性值
使用autocad对象模型即可解决,首先利用(ssget)等函数得到该属性块图元名,然后将其转换成vla对象,然后通过vla-getarrite方法取得块中的属性数组,再得到每个属性定义的vla对象,用vla=get-textstring 得到其属性值,其它联系ljttjl@tom.com
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2025-12-26 04:42 , Processed in 0.182856 second(s), 26 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.