AutoCAD LT's Dimension Style setting for the Tolerance format, Method: Deviation, Tolerance alignment: Align decimal separators

AutoCAD LT's Dimension Style setting for the Tolerance format, Method: Deviation, Tolerance alignment: Align decimal separators

BigDan72
Community Visitor Community Visitor
140 Views
6 Replies
Message 1 of 7

AutoCAD LT's Dimension Style setting for the Tolerance format, Method: Deviation, Tolerance alignment: Align decimal separators

BigDan72
Community Visitor
Community Visitor

I've done some research and found that AutoCAD LT controls the MTEXT stacked text formatting of a dimension's tolerance set to Deviation as up carrot (^) to be "Align operational symbols" and then tilde+period (~.) to be "Align decimal separators". I want to control this setting via AutoLISP (preferred) or another API interface, so that each time I open a drawing, the "Align decimal separators" (~.) setting is active. I have found no DIM variable setting for this in AutoCAD LT. And Autodesk support has confirmed that no setting exists. They only recommend using the Dimension Styles Manager. But this doesn't allow me to automate.

0 Likes
141 Views
6 Replies
Replies (6)
Message 2 of 7

robthenry0
Explorer
Explorer

Setting the tolerance format correctly in AutoCAD LT dimension styles can make technical drawings much clearer and more consistent. It would be helpful to compare the available tolerance options and explain which settings control the displayed upper and lower limits, precision, and alignment.

0 Likes
Message 3 of 7

lauri_barnhart
Autodesk
Autodesk

Welcome to the community, @BigDan72.

 

Thank you for posting your question. Checking in to see if you found a solution or still need assistance. Any update you can provide would be greatly appreciated.

 

Best,


Lauri | Community Manager
0 Likes
Message 4 of 7

BigDan72
Community Visitor
Community Visitor

I have not received any feedback on a solution to automate this. But my workaround is my own generation of an AutoLISP routine that I invoke when needed. This semi-works for me and my workflow. I work with thousands of pre-existing drawings that generally do not have the tolerance as part of the dimensions' internal MTEXT value. But I want to "fix" that for the CAD files I touch.

 

(defun c:adt_SET-TOLERANCE-TO-ALIGN-BY-DECIMAL ( / ent ed s len i new )
;; Select MTEXT entity
(setq ent (car (nentsel "\nSelect MTEXT: ")))
(if ent
(progn
;; Read DXF group 1 (MTEXT content)
(setq ed (entget ent))
(setq s (cdr (assoc 1 ed)))
;; Only proceed if MTEXT contains a tolerance stack
(if (and s (wcmatch s "*\\S*"))
(progn
;; Find the first ^ and replace it with ~.
(setq len (strlen s))
(setq i 1)
;; Scan string until we find "^"
(while (and (<= i len)
(/= (substr s i 1) "^"))
(setq i (1+ i))
)
;; If ^ was found, replace it with "~."
(if (<= i len)
(progn
(setq new
(strcat
(substr s 1 (1- i)) ;; before ^
"~." ;; replacement
(substr s (1+ i)) ;; after ^
)
)
;; Write updated MTEXT back
(entmod (subst (cons 1 new) (assoc 1 ed) ed))
(entupd ent)
)
)
)
)
)
)
(command "regen")
(princ)
)

Message 5 of 7

h_s_walker
Mentor
Mentor

@BigDan72 Why not set up a dimension style as you want. Copy that dimension style into the relevant drawing and then change the dimensions to that which you want?

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 6 of 7

BigDan72
Community Visitor
Community Visitor

I found that working with preexisting drawings. Dimension styles don't propagate very well. None of the drawings I work with had dimension styles other than a "Standard" dimstyle. These are pretty old DWG files. You have sparked my interest in revisiting this as a possible "fix".

0 Likes
Message 7 of 7

pendean
Community Legend
Community Legend

@BigDan72 wrote:

I found that working with preexisting drawings. Dimension styles don't propagate very well. None of the drawings I work with had dimension styles other than a "Standard" dimstyle. These are pretty old DWG files. You have sparked my interest in revisiting this as a possible "fix".


So most of us have at least that one template file with all of our custom STYLEs in it (and we never call anything 'STANDARD", that's for rookies), then simply drag and drop using ADCENTER command (or any other methods you like to use). Our own Styles in other's drawings.

 

The concept works well for LAYERs, text styles, MLEADERSTYLEs and so much more.

0 Likes