@buzzytrent ,
Assuming the answer to my previous question is "yes" then give this a try. I have included some commented-out parts where you can select which layer and dimstyle (otherwise currents are used):
(defun c:XYA ( / p1 p2 e x y txt osm lyr dms)
;X/Y Aligned dim
;get points for dim
(initget 1) (setq p1 (getpoint "\nSelect First Point: "))
(initget 1) (setq p2 (getpoint p1 "\nSelect Second Point: "))
;prep
(setq osm (getvar 'OSMODE)) (setvar 'OSMODE (logior 16384 osm))
;(setq lyr (getvar 'CLAYER)) (setvar 'CLAYER "MyDimLayer")
;(setq dms (getvar 'DIMSTYLE)) (setvar 'DIMSTYLE "MyDimStyle")
;calc x/y vals
(setq x (/ (abs (- (car p2) (car p1))) 1000.0)
y (/ (abs (- (cadr p2) (cadr p1))) 10.0))
(princ x) (princ "\n")
;round-up to nearest 1000 for x
(if (> x (fix x)) (setq x (1+ (fix x))) (setq x (fix x)))
;round-up to nearest 5 for y
(if (> (fix (+ 0.5 y)) (fix y)) (setq y (+ 5 (* 10 (fix y)))) (setq y (* 10 (fix y))))
;create dim
(command "_.DIMALIGNED" p1 p2 p2)
(if (and (setq e (entlast)) (member '(100 . "AcDbAlignedDimension") (entget e)))
(progn
(setq txt (strcat (itoa x) " LENGTHS @ " (itoa y)))
(setpropertyvalue e "DimensionText" txt)
);progn
;else
(prompt "\n...no dimension created.")
);if
;restore
(setvar 'OSMODE osm)
;(setvar 'CLAYER lyr)
;(setvar 'DIMSTYLE dms)
;finish
(prompt "\nXYA Complete...")
(princ)
);defun
Best,
~DD