自己想实现 将选择的对象变换到指定的图层,如果没有选择对象则将这个命令包含的图层设为当前。
例如 我选择一条直线,输入命令C1,将其转换到预先设置好的“1”图层中;如果没有选择任何对象,而输入命令“C1”,那就将“1”图层设为当前。这个就是天河CAD的图层变换工具的功能。
自己想把这个命令写出来,但是谁为当前图层不知道该如何来做?不知道该怎么来识别没有选择对象的情况。
很傻很天真的求助中...
(defun C:C0 () (ssget) (command "change" "P" "la" "0" "")) (defun C:C1 () (ssget) (command "change" "P" "la" "1" "")) (defun C:C2 () (ssget) (command "change" "P" "la" "2" "")) (defun C:C3 () (ssget) (command "change" "P" "la" "3" "")) (defun C:C4 () (ssget) (command "change" "P" "la" "4" "")) (defun C:C5 () (ssget) (command "change" "P" "la" "5" "")) (defun C:C6 () (ssget) (command "change" "P" "la" "6" "")) |