Solid Edge Addin for command bar in C#

[ Edited ]

Hi Jason and RD,

Do you have Solid Edge addin example for command bar in C# similar to VC++ addin example(C:\Program Files\Solid Edge ST4\SDK\Samples\Addins\VC)?


Thank you,



Posted by: Amit Wadekar
Post date: 4/20/2012 3:45:54 AM


Re: Solid Edge Addin for command bar in C#

[ Edited ]

don't have a clean full example but here is the basics for it (nor did I tested this)

you can have a more info (much more detailed under "Solid Edge ST4\SDK\Samples\Addins\Doc" )


namespace ureProjNameSapce
    public class AddIn : SolidEdgeFramework.ISolidEdgeAddIn
        private SolidEdgeFramework.AddIn m_addin;
        private SolidEdgeFramework.Application m_application;
        private SolidEdgeFramework.DISEApplicationEvents_Event appEvents;
        private SolidEdgeFramework.DISEAddInEvents_Event addinEvents;
 public void OnConnection(object Application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
            // Store local variables for later use
            m_addin = AddInInstance;
            m_application = (SolidEdgeFramework.Application)Application;
            // Set Addin's GUI Version
            AddInInstance.GuiVersion = 1;

            // Get a reference to the application events
            appEvents = (SolidEdgeFramework.DISEApplicationEvents_Event)m_application.ApplicationEvents;
            //hang events here..

 public void OnConnectToEnvironment(string EnvCatID, object pEnvironmentDispatch, bool bFirstTime)
                string[] commandNames = new string[5];
                commandNames[0] = "cmdAbout\n\nAbout System\nAbout";
                commandNames[1] = "cmdTester\n\nTester\nDebug";
                int[] commandIDs = new int[5];
                commandIDs[0] = 101;
                commandIDs[1] = 102;
                //on every entry to enviroment (part/assembly/etc..) this func is called..
                m_addin.SetAddInInfo(Marshal.GetHINSTANCE(this.GetType().Module).ToInt32(), EnvCatID, "ManagedMenu", 1, 2, 1, 2, commandIDs.Length, commandNames, commandIDs);
                if (bFirstTime) 
                    SolidEdgeFramework.Environment env = (SolidEdgeFramework.Environment)pEnvironmentDispatch;
                    m_addin.AddCommandBarButton(EnvCatID, "ManagedMenu", 101);
                    m_addin.AddCommandBarButton(EnvCatID, "ManagedMenu", 102);                    

            catch (System.Exception ex)


Best regards.


Posted by: joseph polk
Post date: 5/6/2012 2:17:10 PM