- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, i'm having an issue with the ribbon tab.
When i execute this code from an assembly, to unfold all sheetmetal parts, the main assembly ribbon tab turns in a sheetmetal ribbon tab.
Sub createFlatPattern(doc As PartDocument)
Dim metaldef As SheetMetalComponentDefinition
Set metaldef = doc.ComponentDefinition
If Not metaldef.HasFlatPattern Then
metaldef.Unfold
metaldef.FlatPattern.ExitEdit
End If
End SubAs you can see, i'm currently in a assembly document and the sheetmetal ribbon tab is active.
I want a way to fix it, please.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
See this link to a past discussion/solution to this issue:
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello @Curtis_Waguespack
The method that you show me its to add a view to the part to make it visible and then unfold it. I can't use this method because I have a lot of OnOpenDocument events and it pop-ups message boxes. Making the code to unfold all parts freezes until someone close the messagebox.
I found a way to "refresh" the ribbon when the code finish.
AssemblyDocument assemblyDocument = (AssemblyDocument)invApp.ActiveDocument;
invApp.CommandManager.ControlDefinitions["AppShowHomeBaseCmd"].Execute2(true); // ( HomeBaseView )
assemblyDocument.Activate();When the code ends, it change to the HomeBaseView and back to the assembly.
Anyway, thanks @Curtis_Waguespack for the help!