Update all Styles of IPT file through API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I'm currently working on a tool that updates elements of drawing files (Borders, Titleblocks etc.) and purges unused local Styles of the drawings. The customer asked me whether it would be possible to extend the functionality and also update the styles of their IPT (both regular IPT and sheetmetal) files.
Unlike the Inventor.DrawingDocument, the Inventor.PartDocument doesn't have a StylesManager (Inventor.DrawingStylesManager) to iterate over all the Styles.
I can individually iterate the items in the .Materials, .RenderStyles and .LightingStyles collections of the Inventor.DrawingDocument and also the .SheetMetalStyles of the Inventor.SheetMetalComponentDefinition (if the IPT is actually a sheet metal part).
But the Update Styles dialog in the Manage ribbon can also contain objects that don't seem belong to any of those categories (see example image below).
Is there any way to update all Styles of an IPT through the API?
I'm aware that it's technically possible to simulate a click on the Ribbon Button to open the built in dialog. But I'd then also have to simulate a click on the OK button afterwards. That would be messy, but could work - but the function is supposed to be part of a larger batch processing program that will handle many different files in sequence, so a more robust solution is required.