本帖最后由 xiaocainiao 于 2024-5-8 19:03 编辑
- ;图层切换
- (defun lay_qh (lay lay_col lay_lt / lay_s)
- (setq lay_s (tblsearch "layer" lay))
- (if (= lay_s nil)
- (command "-layer" "n" lay "c" lay_col lay "lay_lt" lay_lt lay "")
- )
- (setvar "clayer" lay)
- )
- (defun c:DEF()(lay_qh "Defpoints" 7 "Continuous"))
- (defun c:00()(lay_qh "Defpoints" 7 "Continuous"))
- (defun c:QT()(lay_qh "墙体" 5 "Continuous"))
上面是我目前使用的图层切换代码、
有多少个图层就要复制多少行代码、然后再修改快捷键和对应图层线性、感觉有点麻烦
现在我把快捷键和图层信息都放在表里面、代码如下:
- (setq lay_lst (("DEF" "Defpoints" "7" "Continuous") ("00" "0" "7" "Continuous") ("QT" "墙体" "5" "Continuous")))
然后想着根据表信息来批量创建图层切换快捷键、
不知道用Lisp能否实现、特来请教一下各位大神!
|