/// <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) { // If you makes changes to your ribbon, be sure to increment the GuiVersion or your ribbon // will not initialize properly. AddInEx.GuiVersion = 1; // 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); }
/// <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) { // If you makes changes to your ribbon, be sure to increment the GuiVersion or your ribbon // will not initialize properly. AddInEx.GuiVersion = 1; // 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); }
public Ribbon3d() { // Get a reference to the current assembly. This is where the ribbon XML is embedded. var assembly = System.Reflection.Assembly.GetExecutingAssembly(); // In this example, XML file must have a build action of "Embedded Resource". this.LoadXml(assembly, _embeddedResourceName); // Example of how to bind a local variable to a particular ribbon control. _buttonBoundingBox = GetButton(20); _buttonOpenGlBoxes = GetButton(21); _buttonGdiPlus = GetButton(22); _checkboxItemset = GetCheckBox(14); _checkNgram = GetCheckBox(15); _buttonHole = GetButton(4); _buttonCutout = GetButton(5); _buttonSlot = GetButton(6); // Example of how to bind a particular ribbon control click event. _buttonBoundingBox.Click += _buttonBoundingBox_Click; _buttonOpenGlBoxes.Click += _buttonOpenGlBoxes_Click; _buttonGdiPlus.Click += _buttonGdiPlus_Click; _buttonHole.Click += _buttonHole_Click; _buttonCutout.Click += _buttoncutout_Click; _buttonSlot.Click += _buttonSlot_Click; _checkboxItemset.Click += _itemset_Checked; _checkNgram.Click += _ngram_Checked; _checkboxItemset.Checked = true; // Get the Solid Edge version. var version = DemoAddIn.Instance.SolidEdgeVersion; _application = DemoAddIn.Instance.Application; // Create an instance of the default connection point controller. It helps manage connections to COM events. _connectionPointController = new SolidEdgeCommunity.ConnectionPointController(this); // View.GetModelRange() is only available in ST6 or greater. if (version.Major < 106) { _buttonBoundingBox.Enabled = false; } }