That should work as it stands now. The error appears ONLY if there dimensions found, either on a locked layer [ not seen on screen probably off/frozen ]
or the Dimension object(s) are on another layout other than the current tab not accessible by command call
Try changing the ssget filter to something like this
(setq A1 (ssget "_X" (list '(0 . "DIMENSION")(Cons 410 (getvar 'ctab)))))