Ribbon Tab bug

Ribbon Tab bug

gustavo.cassel
Advocate Advocate
329 Views
2 Replies
Message 1 of 3

Ribbon Tab bug

gustavo.cassel
Advocate
Advocate

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 Sub

gustavocassel_0-1669750050447.png

As 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.

 

0 Likes
Accepted solutions (1)
330 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @gustavo.cassel 

 

See this link to a past discussion/solution to this issue:

 

https://forums.autodesk.com/t5/inventor-forum/toolbar-switching-to-sheet-metal-part-when-ilogic-rule...

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
 

EESignature

0 Likes
Message 3 of 3

gustavo.cassel
Advocate
Advocate

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!