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

Awesome, that's it! :slightly_smiling_face: And it even works with the ButtonDefinition :winking_face:

            // disable new button in all environments except drawings
            foreach (Inventor.Environment oTempEnv in Plugin.m_inventorApplication.UserInterfaceManager.Environments)
            {
                if (oTempEnv.InternalName != "DLxDrawingEnvironment")
                {
                    try
                    {
                        //ControlDefinition myDrawingCommand = Plugin.m_ConDefs[InternalName];
                        //oTempEnv.DisabledCommandList.Add(myDrawingCommand);
                        oTempEnv.DisabledCommandList.Add((ControlDefinition)Btn.ButtonDefinition);
                    }
                    catch
                    {
                    }
                }
            }