Try this, change the blkScale var as needed. This version is automatic & processes current space.
;; FlagNonAssocDims, by CAB at TheSwamp.org 01.24.2008
;; Places a block over Non Associated Dim's
(defun c:FNAD( / ss lst itm pt blk sc doc Space blksize
GetDimAssocFlag)
(setq blksize 1.0) ; scale of the block size, change to suit
;; by MP http://www.theswamp.org/index.php?topic=7788.msg99023#msg99023
;; Will return a bitsum value reflecting associativity (+ 1 2 4 8) or nil.
(defun GetDimAssocFlag ( dimobj / result )
(if (eq :vlax-true (vla-get-hasextensiondictionary dimobj))
(vl-catch-all-apply
'(lambda ( )
(setq result
(cdr
(assoc 90
(entget
(vlax-vla-object->ename
(vla-getobject
(vla-getextensiondictionary dimobj)
"ACAD_DIMASSOC"
)
)
)
)
)
)
)
)
)
result
)
(if (not(tblsearch "BLOCK" "NotAllowed"))
(progn
(entmake '((0 . "BLOCK") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbBlockReference")
(2 . "NotAllowed") (10 0.0 0.0 0.0) (70 . 0)))
(entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbPolyline")
(90 . 2) (70 . 0) (43 . 0.1) (38 . 0.0) (39 . 0.0)(10 0.707107358883519 0.707106203489104)
(40 . 0.1) (41 . 0.1) (42 . 0.0) (10 -0.707107358883519 -0.707106203489104)
(40 . 0.1) (41 . 0.1) (42 . 0.0)))
(entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbPolyline") (90 . 2)
(70 . 1) (43 . 0.1) (38 . 0.0) (39 . 0.0) (10 0.707107358883519 0.707106203489104) (40 . 0.1)
(41 . 0.1) (42 . -1.0) (10 -0.707107358883519 -0.707106203489104) (40 . 0.1) (41 . 0.1)
(42 . -1.0)))
(entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
)
)
;;(prompt "\nSelect Dim's to test associativity.")
(if(setq ss (ssget "X" (list '(0 . "DIMENSION")(cons 410 (getvar "ctab")))))
(progn
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace Doc) (vla-get-ModelSpace Doc)))
(setq lst (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))))
(foreach itm lst
(if (not(GetDimAssocFlag itm))
(progn
(setq pt (vla-get-TextPosition itm)
sc blksize ; (vla-get-ScaleFactor itm)
)
(setq blk (vla-insertblock Space
pt ; insert point
"NotAllowed" ; block name
sc sc sc ; scale x y z
0.0 ; radians
)
)
(vla-put-layer blk "0") ; Layer
(vlax-release-object blk)
)
)
)
)
)
(princ)
)
(prompt "\nFlagNonAssocDims loaded, Enter FNAD to run.")
(princ)