Thanks Tim,
Well this is as far as I got, fighting the flu, so maybe tomorrow.
Did not know how to get the actual rotation of the dimension line.
(defun c:fixdims ()
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vla-startundomark doc)
(and (or (ssget '((0 . "DIMENSION") (-4 . "<NOT") (1 . "") (-4 . "NOT>")))
(ssget "X" '((0 . "DIMENSION") (-4 . "<NOT") (1 . "") (-4 . "NOT>"))))
(setq ss (vla-get-activeselectionset
(vla-get-activedocument
(vlax-get-acad-object)
)
)
) ;use ActiveX ss
(setq mspace (vla-get-modelspace
(vla-get-activedocument
(vlax-get-acad-object)
)
))
(vlax-for x ss
(if (vl-string-search "%%2" (setq str (vla-get-textoverride x)))
(progn
(vlax-dump-object x T)
(if (setq newobj (vla-addtext mspace str (vla-get-textPosition x) (vla-get-textheight x)))
(progn
(vlax-put-property newobj 'Alignment acAlignmentMiddleCenter)
(vla-put-textAlignmentPoint newobj (vla-get-TextPosition x))
;;(vla-put-Rotation newobj (vla-get-Rotation x))
(vla-put-StyleName newobj (vla-get-TextStyle x))
(vla-put-Height newobj (* (vla-get-ScaleFactor x)(vla-get-TextHeight x)))
(vla-put-Layer newobj (vla-get-Layer x))
(vla-put-Color newobj (vla-get-TextColor x))
(vla-put-textoverride x " ")
(vlax-release-object newobj)
)
(prompt (strcat "\nERROR replacong dimtext " str))
)
)
)
)
(vlax-release-object mspace)
)
(vla-endundomark doc)
(princ)
)