求助,获取当前布局名称
(defun c:qq ()(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq layouts (vla-get-layouts doc))
(setq count (vla-get-count layouts))
(repeat count
(princ "\n")
(princ (vla-get-name (vla-item layouts (1- count))))
(setq count (1- count))
)
(princ)
)大佬们,小弟有个问题,搜索了没找到答案,蛮提问一下。
想要获取当前布局名称。有看到这个命令layout,尝试没成。
上面这个程序,是别的帖子的,可以列出所以布局名,没法知道当前的布局位置。
望大佬解答!
(defun c:q ()
(vl-load-com);初始化ActiveX环境
(setq app (vlax-get-acad-object);_应用程序,返回VLA对象
doc (vla-get-activedocument app);_当前文档,返回VLA对象
layout (vla-get-activelayout doc);_当前布局,返回VLA对象
)
(princ (vla-get-namelayout));返回当前布局名称
(princ)
)
可以了 (getvar "CTAB") (vla-get-Name (vla-get-ActiveLayout (vla-get-ActiveDocument(vlax-get-acad-object))))
or
(getvar "CTAB")
(vlax-get-property(vlax-get-property(vlax-get-acad-object)'activedocument)'activelayout)
页:
[1]