防止cad文件损坏,而导致工作内容丢失,随时备份cad文件指令:BCC
(defun c:Bcc (/ sj fn n)
;将cad备份为新的文件,后缀时间例如“新图纸-20240725235717.dwg”;精确到秒。
;这样我们每次画图都可以随时保存备份,而不必担心cad图纸损坏而无法恢复。
(command "qsave" )
(setq sj (getvar "cdate")
sj (* 10000 sj)
sj (rtos sj 2 0)
fn (strcat (getvar "DWGPREFIX") (getvar "DWGNAME"))
n (strlen fn)
fn (substr fn 1 (- n 17))
fn (strcat fn "-" sj ".dwg")
)
(command "saveas" "2024" fn )
(prompt "文件已经保存;并且另存为:")
(princ fn)
(princ)
)