Originally Posted by
Tom Beauford
Here's a quick modification to the linked code from Tom's apt post:
Code:
(defun c:-D (/ ) (_AddSubtractDim -1.5))
(defun c:+D (/ ) (_AddSubtractDim 1.5))
;;;--------------------------------------------------------------------;
(defun _AddSubtractDim (addon / dimss c ddata); = Dimension Text: Add Constant value
(setq
;;; addon (getreal "\nConstant value to add to text of selected Dimension(s): ")
dimss (ssget ":L" '((0 . "DIMENSION")))
c -1
)
(repeat (sslength dimss)
(setq
ddata (entget (ssname dimss (setq c (1+ c))))
ddata
(subst
(cons 1 (rtos (+ (cdr (assoc 42 ddata)) addon) 2 2)); <-- adjust mode/precision as desired
(assoc 1 ddata)
ddata
)
)
(entmod ddata)
)
(princ)
)
If not already done so, it might make sense to have disparate layers for those you're reducing vs those you're increasing. Just to make it easier to select similar & invoke -D or +D, etc.
Cheers