I added a little twist to this routine. I used the LSP above and created a routine that ALWAYS deletes all annotation scales and ALWAYS sets the default to 1:1. This will work even if the 1:1 annotation scale is missing.
We are having too many problems with THOUSANDS of annotation scales. We are using the cleanup utility over and over. This way, when someone opens a drawing it will automatically set the scale to 1:1 and delete the rest.
Code:
(defun PurgeAnnoScales (/ slist scaleDict scaleDictName csobj num index scaleObject item entnm ent aScale
tempNameObj tempFirst RatioObj tempLastRatioObj tempDictList tempDictListEnt
newScaleDict)
(setq slist '("1:1"))
(setq scaleDict (dictsearch (namedobjdict) "ACAD_SCALELIST"))
(setq scaleDictName (cdar scaleDict))
(setq csobj (vlax-ename->vla-object scaleDictName))
(setq num (vla-get-count csobj))
(setq index 0)
(repeat num
(setq scaleObject (vlax-invoke-method csobj 'item index))
(setq entnm (vlax-vla-object->ename scaleObject))
(setq ent (entget entnm))
(if (not (member (setq aScale (cdr (assoc 300 ent))) slist))
(progn (entdel entnm))
(progn (setq index (+ index 1)))
)
)
(if (= 0 (vla-get-count csobj))
(progn
;CONSTRUCT THE FEATURE DATA PAIR
(setq tempNameObj (cons 300 "1:1"))
(setq tempFirstRatioObj (cons 140 1.0))
(setq tempLastRatioObj (cons 141 1.0))
(setq tempDictList (append (list '(0 . "SCALE") '(100 . "AcDbScale")) (list tempNameObj) (list tempFirstRatioObj) (list templastRatioObj)))
(setq tempDictListEnt (entmakex tempDictList))
(setq newScaleDict (dictadd scaleDictName (strcat (rtos 1.0 2 6) "_" (rtos 1.0 2 6)) tempDictListEnt))
(setvar "cannoscale" "1:1")
);end progn
(setvar "cannoscale" "1:1")
);end if
(princ));end