Hi all
I am looking for a rule to remove all colour overides in all assemblies and .ipts
When we merged all our data across to inventor 2013 all our visual styles and materials where all over the place and has still to be resolve by autodesk.However when we update our parts via stlyes and stds some .ipts have a colour overide assigned to them and we have to go into each part individually to remove the colour overide.
Is there a rule that will work at top level and look down stream and remove all colour overides in all .ipts and iams without editing all individually
Removing apperance overides does not work for this
any thought's on this would be appreciated
Dave
Hi dclunie,
Did this work?:
http://forums.autodesk.com/t5/Autodesk-Inventor/vb-ilogic-rule/m-p/3641848#M449749
If not, it might help others work out a solution.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
HI Curtis
I got the following error message when i run the rule,so i posted it on customization site as you recommended
Error in rule: Rule0, in document: SHR-04-0307-000.iam
Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.PartComponentDefinition'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{DA33F1A3-7C3F-11D3-B794-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Many thanks
DClunie
Referenced code works with part documents only.
Add a pair of lines in your code to avoid assemblies.
'Look at all of the files referenced in the open document Dim docFile As Document For Each docFile In openDoc.AllReferencedDocuments If docFile.DocumentType = kPartDocumentObject Then '<----- Add Dim oCompDef As Inventor.PartComponentDefinition oCompDef = docFile.ComponentDefinition 'Iterate through all features Dim oFeature As PartFeature For Each oFeature In oCompDef.Features 'Set the render style to be "As Body" oFeature.SetRenderStyle (37125) Next '.............. End If '<----- Add Next
Hi
Can i ask what do you mean add acouple of lines in code to avoid assemblies?
Dave
These two lines have comment '<----- Add :
If docFile.DocumentType = kPartDocumentObject Then '<----- Add
......... <any code here for parts only>..........
End If '<----- Add