Z轴归零小程序,直接新建文本复制粘贴,改后缀lsp,保存,CAD加载运行命令Z0
(defun C:Z0 ( / SS1)
(setvar "cmdecho" 0)
(if (setq SS1 (ssget))
(progn
(command ".undo" "be")
(princ "\n正在处理图形数据,请稍候...")
(terpri)
(command ".ucs" "w")
(command ".move" SS1 "" '(0 0 1e99) "" ".move" "p" "" '(0 0 -1e99) "")
(princ "\nOK,已将所选图元Z坐标值全部归零。")
(command ".undo" "e")
);end progn
);end (if (/= SS1 nil)
(princ)
);end (defun C:Z=0 ( / SS1)