Exemplo n.º 1
0
        public override void OnConnection(SolidEdgeFramework.SeConnectMode ConnectMode)
        {
            ComEventsManager = new ComEventsManager(this);

            // Prepend '\n' to the description to allow the addin to have its own Ribbon Tab.
            // Otherwise, addin commands will appear in the Add-Ins tab.
            AddInInstance.Description = $"\n{AddInInstance.Description}";

            // If you makes changes to your ribbon, be sure to increment the GuiVersion. That makes bFirstTime = true
            // next time Solid Edge is started. bFirstTime is used to setup the ribbon so if you make a change but don't
            // see the changes, that could be why.
            AddInInstance.GuiVersion = 2;

            // Example of how to hide addin from the Add-In Manager GUI.
            //AddInInstance.Visible = false;

            // Connect to select COM events.
            // 1) Modify class to implement desired event interface(s).
            // 2) Attach to each event set via ComEventsManager.Attach().
            ComEventsManager.Attach <SolidEdgeFramework.ISEAddInEventsEx>(AddInInstance);
            ComEventsManager.Attach <SolidEdgeFramework.ISEAddInEdgeBarEventsEx>(AddInInstance);
            ComEventsManager.Attach <SolidEdgeFramework.ISEApplicationEvents>(Application);

            // Solid Edge 2020 or higher.
            if (SolidEdgeVersion.Major >= 220)
            {
                ComEventsManager.Attach <SolidEdgeFramework.ISEAddInEventsEx2>(AddInInstance);
                ComEventsManager.Attach <SolidEdgeFramework.ISEApplicationEventsEx2>(Application);
            }

            My3dViewOverlay = new My3dViewOverlay(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called when the addin is first loaded by Solid Edge.
        /// </summary>
        public override void OnConnection(SolidEdgeFramework.Application application, SolidEdgeFramework.SeConnectMode ConnectMode, SolidEdgeFramework.AddIn AddInInstance)
        {
            _application = application;

            // If you makes changes to your ribbon, be sure to increment the GuiVersion or your ribbon
            // will not initialize properly.
            AddInEx.GuiVersion = 1;
            //krkmfkrnkj
            // Create an instance of the default connection point controller. It helps manage connections to COM events.
            _connectionPointController = new SolidEdgeCommunity.ConnectionPointController(this);

            // Uncomment the following line to attach to the Solid Edge Application Events.
            _connectionPointController.AdviseSink <SolidEdgeFramework.ISEApplicationEvents>(this.Application);

            // Not necessary unless you absolutely need to see low level windows messages.
            // Uncomment the following line to attach to the Solid Edge Application Window Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEApplicationWindowEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge Feature Library Events.
            _connectionPointController.AdviseSink <SolidEdgeFramework.ISEFeatureLibraryEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge File UI Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEFileUIEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge File New UI Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISENewFileUIEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge EC Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEECEvents>(this.Application);

            // Uncomment the following line to attach to the Solid Edge Shortcut Menu Events.
            //_connectionPointController.AdviseSink<SolidEdgeFramework.ISEShortCutMenuEvents>(this.Application);
        }