- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Drawings: Revert all override dimensions back to default
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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:
You can combine the two to get the desired effect.
Alex Fielder
Inventor Expert
https://github.com/alexfielder/
LinkedIn - Github Inventor Extension Server - Bonkers polygon iLogic thing
Top ten iLogic Tips - API Shortcut In Google Chrome - Assembly Extrusion Example