Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Ribbon Tab bug

gustavo.cassel
Advocate

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
Reply
Accepted solutions (1)
300 Views
2 Replies
Replies (2)

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
 

0 Likes

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!