@Kent1Cooper wrote:
.... If you might have some already-supplied override text content as pre- or suffix to that, the code can be modified to include that.
Such as this:
(defun C:DMTO ; = Dimension Measurement-Text Override
(/ dimsel dim ddata)
(if (setq dimsel (entsel "\nSelect Dimension to override text with measured distance: "))
(progn
(setq
dim (car dimsel)
ddata (entget dim)
); setq
(entmod
(subst
(cons 1
(cond
((member '(1 . "") ddata); text is only default [no override already]
(rtos (cdr (assoc 42 ddata))); text equivalent of measured distance
); default condition
((wcmatch (cdr (assoc 1 ddata)) "*<>*"); override including measured distance
(vl-string-subst (rtos (cdr (assoc 42 ddata))) "<>" (cdr (assoc 1 ddata)))
; replace measured-distance portion with equivalent text override
); measured-distance-included condition
((strcat (rtos (cdr (assoc 42 ddata))) " " (cdr (assoc 1 ddata))))
; none-of-the-above; add measured-distance text to beginning of override
); cond
); cons
(assoc 1 ddata)
ddata
); subst
); entmod
); progn
); if
(princ)
); defun
Note the third option, if there's an override that doesn't include the measured distance -- as written, it adds the measured distance [and a space] before the current override text, but you may want a different outcome if you might have that situation.
Other questions arise:
It seems like a potentially dangerous thing to do, with concerns such as potential liability implications. So I'd be very careful about using it only in very limited and thoughtfully-evaluated circumstances. You might even have it always include something like "N.T.S." [= Not To Scale] at the end.
This is only for distance Dimensions. What if you pick an angular Dimension? Would there ever be a need for that? I can't imagine one, but that could be accommodated if necessary, or it could be built to prevent use on angular Dimensions.
Kent Cooper, AIA