Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Drawings: Revert all override dimensions back to default

RoyWickrama_RWEI
Advisor

Drawings: Revert all override dimensions back to default

RoyWickrama_RWEI
Advisor
Advisor

I got of work on bunch of drawings.

One of my co-workers has overridden many dimensions in drawings. Upon, model changes I found dimensions are not updating.

 

Could someone help me with some coding to get all such dimensions reverted back to default dimensions.

Thanks.

 

 

 

0 Likes
Reply
368 Views
3 Replies
Replies (3)

Anonymous
Not applicable

This will reset overridden dimensions of the GeneralDimension Type.

 

Dim oApp As Inventor.Application = ThisApplication
Dim oDoc As DrawingDocument = oApp.ActiveDocument
Dim oSheet As Sheet

For Each oSheet In oDoc.Sheets
	For Each oDrawingDim As GeneralDimension In oSheet.DrawingDimensions.GeneralDimensions
		If oDrawingDim.ModelValueOverridden Then
			oDrawingDim.ModelValueOverridden = False
		End If
	Next
Next

 

You will have to loop through other dimension types as well if they exist on the drawing. See the following link for further details on the DrawingDimensions Object.

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2018/ENU/Inventor-API/files/Dr...

 

RoyWickrama_RWEI
Advisor
Advisor

Code looks good. But, it does not do anything.

Not sure why.

 

Thanks.

0 Likes

AlexFielder
Advisor
Advisor

Hi @RoyWickrama_RWEI as @Anonymous mentioned, with your current code you're only referencing one of the DrawingDimension sub-types.

The code in this post takes a broader approach and demonstrates how to change the colour of any overridden dimension regardless of its type:

 

https://forums.autodesk.com/t5/inventor-customization/macro-add-in-to-show-override-dimensions-in-sketch/m-p/7603923/highlight/true#M77816

 

You can combine the two to get the desired effect.

0 Likes