How to center all dimension text in Inventor drawing at one time

Q: This is the retrieved size. How can I center all linear sizes at once? Now it is all manually dragged one by one, which is very troublesome.

A: There is no way to do it on the UI. But with iLogic can be achieved simply. (There are examples in the help.)

Create a new iLogic rule in the drawing, and paste the following code. It can realize the text centering of all length dimensions and angle dimensions under the active sheet.Copy the code below:

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oDrawingDim As DrawingDimension
For Each oDrawingDim In oSheet.DrawingDimensions
If TypeOf oDrawingDim Is LinearGeneralDimension Or _
TypeOf oDrawingDim Is AngularGeneralDimension Then
Call oDrawingDim.CenterText
End If
Next

Set the event trigger to trigger the rule to run before the file is saved.

Leave a Reply