;全图单位米和毫米互转.lsp
(defun mai_dwg_chgunits ( sca / ss )
  (command "_.layer" "thaw" "*" "unlock" "*" "on" "*" "")
  (command "_.ucs" "")
  (command "_.plan" "")
  (and (setq ss (ssget "x"))
       (command "_.scale" ss "" "non" "0,0,0" sca)
  )
  (princ)
)
(defun c:mini_dwg_m2mm ( / old_cmd )
  (mai_start nil)
  (mai_last_com "mai_dwg_m2mm")
  (princ "\n将图由米转为毫米.")
  (mai_dwg_chgunits 1000)
  (mai_end)
)
(defun c:mini_dwg_mm2m ( / old_cmd )
  (mai_start nil)
  (mai_last_com "mai_dwg_mm2m")
  (princ "\n将图由毫米转为米.")
  (mai_dwg_chgunits 0.001)
  (mai_end)
)
(defun c:mini_dwg_cm2mm ( / old_cmd )
  (mai_start nil)
  (mai_last_com "mai_dwg_m2mm")
  (princ "\n将图由厘米转为毫米.")
  (mai_dwg_chgunits 10)
  (mai_end)
)
