autocad 二次开发 lisp 求逐行详解,高分加倍悬赏
答案:4 悬赏:60 手机版
解决时间 2021-04-05 17:52
- 提问者网友:我是女神我骄傲
- 2021-04-04 20:15
autocad 二次开发 lisp 求逐行详解,高分加倍悬赏
最佳答案
- 五星知识达人网友:掌灯师
- 2021-04-04 20:31
全部回答
- 1楼网友:一把行者刀
- 2021-04-04 22:09
这个是建立图层 再设置当前图层,关闭与冻结图层
- 2楼网友:逃夭
- 2021-04-04 21:26
(defun main (www / n str lay) 定义一个main函数
(command "_.undo" "_begin") 执行命令undo,做一个开始的标记。具体可help一下undo命令
(command "layer" "s" "0" "") 执行命令layer,设定0层为当前层
(setvar "cmdecho" 0) 关闭命令行显示
(tblnext "layer" T) 回到当前层
(setq n 0) 以下4句查询一共有多少层
(while (tblnext "layer")
(setq n (1+ n))
)
(command "layer" "off" "*" "y" "") 关闭所有层
(command "layer" "on" "0" "") 打开0层on
(tblnext "layer" T) 回到当前层
(repeat n 以下7句,依次找到层名第一个字母为变量www的值的层,然后打开on
(setq lay (cdr (assoc 2 (tblnext "layer"))))
(setq str (substr lay 1 1))
(if (= str www)
(command "layer" "on" lay "")
)
)
(tblnext "layer" T) 以下7句,依次找到层名第一个字母为0的层,然后打开on再锁上lock
(repeat n
(setq lay (cdr (assoc 2 (tblnext "layer"))))
(setq str (substr lay 1 1))
(if (= str "0")
(progn
(command "layer" "on" lay "")
(command "layer" "lo" lay ""))
)
)
(princ "\nzzg编于2005.07.11")
(princ)
) 不知道他要干什么??
(defun c:q0 (/ n lay str)
(main "0")
(command "layer" "u" "*" "")
(command "_.undo" "_end")
)
(defun c:q1 (/)
(main "1")
(command "_.undo" "_end")
)
(defun c:q2 (/)
(main "2")
(command "_.undo" "_end")
)
(defun c:q3 (/)
(main "3")
(command "_.undo" "_end")
)
(defun c:q4 (/)
(main "4")
(command "_.undo" "_end")
)
(defun c:q5 (/ n lay)
(command "_.undo" "_begin")
(setvar "cmdecho" 0)
(command "layer" "on" "*" "")
(command "layer" "u" "*" "")
(command "_.undo" "_end")
)
(defun c:q11 (/ n lay)
(command "_.undo" "_begin")
(setvar "cmdecho" 0)
(command "layer" "u" "*" "")
(command "_.undo" "_end")
)
(command "_.undo" "_begin") 执行命令undo,做一个开始的标记。具体可help一下undo命令
(command "layer" "s" "0" "") 执行命令layer,设定0层为当前层
(setvar "cmdecho" 0) 关闭命令行显示
(tblnext "layer" T) 回到当前层
(setq n 0) 以下4句查询一共有多少层
(while (tblnext "layer")
(setq n (1+ n))
)
(command "layer" "off" "*" "y" "") 关闭所有层
(command "layer" "on" "0" "") 打开0层on
(tblnext "layer" T) 回到当前层
(repeat n 以下7句,依次找到层名第一个字母为变量www的值的层,然后打开on
(setq lay (cdr (assoc 2 (tblnext "layer"))))
(setq str (substr lay 1 1))
(if (= str www)
(command "layer" "on" lay "")
)
)
(tblnext "layer" T) 以下7句,依次找到层名第一个字母为0的层,然后打开on再锁上lock
(repeat n
(setq lay (cdr (assoc 2 (tblnext "layer"))))
(setq str (substr lay 1 1))
(if (= str "0")
(progn
(command "layer" "on" lay "")
(command "layer" "lo" lay ""))
)
)
(princ "\nzzg编于2005.07.11")
(princ)
) 不知道他要干什么??
(defun c:q0 (/ n lay str)
(main "0")
(command "layer" "u" "*" "")
(command "_.undo" "_end")
)
(defun c:q1 (/)
(main "1")
(command "_.undo" "_end")
)
(defun c:q2 (/)
(main "2")
(command "_.undo" "_end")
)
(defun c:q3 (/)
(main "3")
(command "_.undo" "_end")
)
(defun c:q4 (/)
(main "4")
(command "_.undo" "_end")
)
(defun c:q5 (/ n lay)
(command "_.undo" "_begin")
(setvar "cmdecho" 0)
(command "layer" "on" "*" "")
(command "layer" "u" "*" "")
(command "_.undo" "_end")
)
(defun c:q11 (/ n lay)
(command "_.undo" "_begin")
(setvar "cmdecho" 0)
(command "layer" "u" "*" "")
(command "_.undo" "_end")
)
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯