如何关闭打印图层 ,仅显示非打印图层?
(defun layerfrznop ()(setvar "clayer" "0")
(vlax-for lyr (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object)))
(if (zerop (vlax-get lyr 'Plottable))
(vla-put-freeze lyr :vlax-true)
)
)
)
已经在论坛上找到一个 冻结非打印图层的源码如何修改成关闭打印图层 ,仅显示非打印图层?用了检查是否有图元在非打印图层 visual LISP完全看不懂
start4444 发表于 2020-1-8 19:15
(defun c:tt5 ()
(setvar "clayer" "0")
(vlax-for lyr(vla-get-Layers (vla-get-activedocument...
好像反了 这个是关闭非打印图层
我自己研究好了
(defun c:cxf ()
(setvar "clayer" "0")
(vlax-for lyr (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object)))
(vla-put-layeron lyr :vlax-false)
(if (zerop (vlax-get lyr 'Plottable))
(vla-put-layeron lyr :vlax-true)
)
)
) 如果有块存在,这个就不准了。比如说块里有两个图形在图层A、图层B上,而这个块在图形C(不打印图层上)判断就有问题了。 start4444 发表于 2020-1-8 19:15
(defun c:tt5 ()
(setvar "clayer" "0")
(vlax-for lyr(vla-get-Layers (vla-get-activedocument...
谢谢 (defun c:tt5 ()
(setvar "clayer" "0")
(vlax-for lyr(vla-get-Layers (vla-get-activedocument (vlax-get-acad-object)))
(if(zerop (vlax-get lyr 'Plottable))
(vla-put-LayerOn lyr :vlax-false)
)
)
) 江南十笑 发表于 2020-1-9 19:00
好像反了 这个是关闭非打印图层
我自己研究好了
(defun c:cxf ()
:lol是反了 tigcat 发表于 2020-9-20 10:36
如果有块存在,这个就不准了。比如说块里有两个图形在图层A、图层B上,而这个块在图形C(不打印图层上)判 ...
确实有这个问题,网上有个查非打印块的lsp,得用那个再查一遍非打印块 学习了:handshake 江南十笑 发表于 2020-1-9 19:00
好像反了 这个是关闭非打印图层
我自己研究好了
(defun c:cxf ()
(defun c:cxf ()
(setvar "clayer" "0")
(vlax-for lyr (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object)))
(if(vlax-get lyr 'Plottable)
(vla-put-layeron lyr :vlax-false)
)
)
(princ)
)
请问楼主为什么把(zerop (vlax-get lyr 'Plottable))换成(vlax-get lyr 'Plottable)不成功呢
页:
[1]