@kidznok ,
give this a go 🤣
This is auto delete scales according "measurement" sysvar. if it's 0 - imperial, all metric scale is vanish
if it's 1 - metric, all imperial scale is vanish.
enjoy
Moshe
(vl-load-com)
(defun AtSaveCommand (calling-reactor cmd^ / ResetScaleList ;| local function |;)
(defun ResetScaleList (measurement / AcDbScale elist)
(vlax-for AcDbScale (vla-item (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object))) "ACAD_SCALELIST")
(setq elist (entget (vlax-vla-object->ename AcDbScale)))
(cond
((= measurement 0) ; imperial
(if (member (cdr (assoc '300 elist)) rdata^)
(vl-catch-all-apply 'vla-delete (list AcDbScale))
)
); case
((= measurement 1); metric
(if (not (member (cdr (assoc '300 elist)) rdata^))
(vl-catch-all-apply 'vla-delete (list AcDbScale))
)
); case
); cond
(vlax-release-object AcDbScale)
); vlax-for
); resetScaleList
(if (wcmatch (car cmd^) "QSAVE,SAVEAS,SAVE")
(ResetScaleList (getvar "measurement")) ; 0 - imperial, 1 - metric
)
); AtSaveCommand
(defun loadTheSaveReactor ()
(setq rdata^ '("1:1" "1:2" "1:4" "1:5" "1:8" "1:10" "1:16" "1:20" "1:30" "1:40" "1:50" "1:100" "2:1" "4:1" "8:1" "10:1" "100:1")) ; metric scales
(if (not *FileOnSave*)
(setq *FileOnSave* (vlr-command-reactor nil '((:vlr-commandwillStart . AtSaveCommand))))
)
)
(loadTheSaveReactor)