程序代码: | [ 复制代码到剪贴板 ] |
;--------------------------
;通过选择隐藏图层
;__________________________
(defun C:Y()
(princ "\n选取隐藏图层参考对象: ")
(setq ss (ssget))
(setq clay (getvar "clayer"))
(setq ii 0)
(command "-layer")
(repeat (sslength ss)
(setq ent (ssname ss ii))
(setq lay (cdr (assoc 8 (entget ent))))
(if (/= lay clay)
(command "off" lay)(command "off" lay"y")
);end if
(setq ii (1+ ii))
);end repeat
(command "")
);end defun
;--------------------------
;打开所有图层
;__________________________
(defun C:Sa()
(command "-layer""on""*""")
(princ)
)
;-------------------------------------
;图层孤立显示,通过选择对象单显某图层
;_____________________________________
(defun C:g()
(setq ss "" ii 0)
(princ "\n选择要显示的图层:")
(setq ss (ssget))
(if ss (command "-layer""off""*""y"""))
(repeat (sslength ss)
(setq ent (entget (ssname ss ii)))
(setq lay (cdr (assoc 8 ent)) ii (1+ ii))
(command "-layer""on" lay "")
);end repeat
);end defun
(defun c:Layer_ShowAbout()
(princ "\n 隐藏图层 命令 Y")
(princ "\n 显示图层 命令 SA")
(princ "\n 孤立图层 命令 G")
(princ "\n 更多工具请访问:田草博客 www.tiancao.net")
)
(c:Layer_ShowAbout)
;通过选择隐藏图层
;__________________________
(defun C:Y()
(princ "\n选取隐藏图层参考对象: ")
(setq ss (ssget))
(setq clay (getvar "clayer"))
(setq ii 0)
(command "-layer")
(repeat (sslength ss)
(setq ent (ssname ss ii))
(setq lay (cdr (assoc 8 (entget ent))))
(if (/= lay clay)
(command "off" lay)(command "off" lay"y")
);end if
(setq ii (1+ ii))
);end repeat
(command "")
);end defun
;--------------------------
;打开所有图层
;__________________________
(defun C:Sa()
(command "-layer""on""*""")
(princ)
)
;-------------------------------------
;图层孤立显示,通过选择对象单显某图层
;_____________________________________
(defun C:g()
(setq ss "" ii 0)
(princ "\n选择要显示的图层:")
(setq ss (ssget))
(if ss (command "-layer""off""*""y"""))
(repeat (sslength ss)
(setq ent (entget (ssname ss ii)))
(setq lay (cdr (assoc 8 ent)) ii (1+ ii))
(command "-layer""on" lay "")
);end repeat
);end defun
(defun c:Layer_ShowAbout()
(princ "\n 隐藏图层 命令 Y")
(princ "\n 显示图层 命令 SA")
(princ "\n 孤立图层 命令 G")
(princ "\n 更多工具请访问:田草博客 www.tiancao.net")
)
(c:Layer_ShowAbout)
隐藏图层 命令 Y
显示图层 命令 SA
孤立图层 命令 G
更多工具请访问:田草博客 www.tiancao.net
[本日志由 tiancao1001 于 2015-05-11 09:32 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |