如何用LSP语言提取块属性?图块如下
如何用LSP语言提取块属性? 感谢 源码的分享 不知道怎么用 (vl-load-com)(if (setq ent (car (entsel "\n请选取属性块:")))
(if (= (cdr (assoc 0 (entget ent))) "INSERT")
(if (= (vlax-get (setq obj (vlax-ename->vla-object ent)) "HasAttributes") -1)
(progn
(setq att (vlax-invoke obj "GetAttributes"))
(setq jgb (mapcar '(lambda(aobj) (list (vlax-get aobj "TagString")
(vlax-get aobj "TextString")
)
)
att
)
)
(princ "\n属性列表=")(princ jgb)
)
)
)
)
(princ) 谢,非常好用 确实好用。太感谢了!正好需要。 收藏備用,謝謝分享 不知道怎么用 将以下保存为文件"tqksx.lsp",加载后,在命令行输入tqksx,选取带属性的块即列其属性。(defun c:tqksx()
(vl-load-com)
(while (setq ent (car (entsel "\n请选取属性块:")))
(if (= (cdr (assoc 0 (entget ent))) "INSERT")
(if (= (vlax-get (setq obj (vlax-ename->vla-object ent)) "HasAttributes") -1)
(progn
(setq att (vlax-invoke obj "GetAttributes"))
(setq jgb (mapcar '(lambda(aobj) (list (vlax-get aobj "TagString")
(vlax-get aobj "TextString")
)
)
att
)
)
(princ "\n属性列表=")(princ jgb)
)
)
)
)
(princ)
) 学习的好案例 学习中!
页:
[1]
2