I wrote an Add-In that uses custom override environments. These are set when switching to different states in the Add-In to show different commands.
I found a bug in the Factory Design Suite version of Inventor 2012 Professional, 64 bit, Factory Ultimate, Build 160 running on a machine in France.
When I set the override environment, an exception is return with INVALID_ARG.
I tried the same version, and many others here in Canada, and this never happens.
Anyone have any ideas about what might cause this? I'm at an absolute stand-still on this one.
Sorry for reviving this post, but the same error has occured in my project.
When I am trying to set the override environment I am receiving and Argument Exception.
So I tried the API HELP sample for override environments. Same problem here. Any Ideas. Would be great!
Sub AddOverrideEnvironment() ' Make sure a part document is active Dim oPartDoc As PartDocument Set oPartDoc = ThisApplication.ActiveDocument Dim oEnvironments As Environments Set oEnvironments = ThisApplication.UserInterfaceManager.Environments ' Create a new environment Dim oOverrideEnv As Environment Set oOverrideEnv = oEnvironments.Add("Override", "OverrideEnvironment") ' Get the part ribbon Dim oPartRibbon As Ribbon Set oPartRibbon = ThisApplication.UserInterfaceManager.Ribbons.Item("Part") ' Create a contextual tab to be used as the default for the override environment Dim oTabOne As RibbonTab Set oTabOne = oPartRibbon.RibbonTabs.Add("Tab One", "TabOne", "ClientId123", "id_TabSheetMetal", True, False) ' Create panels with the tab Dim oPanelOne As RibbonPanel Set oPanelOne = oTabOne.RibbonPanels.Add("Panel One", "PanelOne", "ClientId123") Dim oDef1 As ButtonDefinition Set oDef1 = ThisApplication.CommandManager.ControlDefinitions.Item("PartExtrudeCmd") Call oPanelOne.CommandControls.AddButton(oDef1, True) Dim oPanelTwo As RibbonPanel Set oPanelTwo = oTabOne.RibbonPanels.Add("Panel Two", "PanelTwo", "ClientId123") Dim oDef2 As ButtonDefinition Set oDef2 = ThisApplication.CommandManager.ControlDefinitions.Item("PartRevolveCmd") Call oPanelTwo.CommandControls.AddButton(oDef2, True) Dim strTabs(0) As String strTabs(0) = "TabOne" oOverrideEnv.InheritAllRibbonTabs = False oOverrideEnv.AdditionalVisibleRibbonTabs = strTabs oOverrideEnv.DefaultRibbonTab = "TabOne" ' Set the override environment on the active part oPartDoc.EnvironmentManager.OverrideEnvironment = oOverrideEnv ' --> ARGUMENT EXCEPTION HERE End Sub