private void ConnectMouse() { _cmd = (SolidEdgeFramework.Command)_application.CreateCommand((int)SolidEdgeConstants.seCmdFlag.seNoDeactivate); _mouse = (SolidEdgeFramework.Mouse)_cmd.Mouse; _cmd.Start(); _mouse.EnabledMove = true; _mouse.LocateMode = (int)SolidEdgeConstants.seLocateModes.seLocateSimple; _mouse.ScaleMode = 1; // Design model coordinates. _mouse.WindowTypes = 1; // Graphic window's only. _mouse.AddToLocateFilter(32); _connectionPointController.AdviseSink <SolidEdgeFramework.ISEMouseEvents>(_mouse); }
private void buttonStartCommand_Click(object sender, EventArgs e) { try { _application = SolidEdgeCommunity.SolidEdgeUtils.Connect(); _command = _application.CreateCommand((int)SolidEdgeConstants.seCmdFlag.seNoDeactivate); _command.Terminate += command_Terminate; _command.Start(); _mouse = _command.Mouse; _mouse.LocateMode = comboBoxLocateModes.SelectedIndex; _mouse.EnabledMove = (bool)comboBoxEnableMouseMoveEvent.SelectedItem; _mouse.ScaleMode = 1; // Design model coordinates. _mouse.WindowTypes = 1; // Graphic window's only. foreach (ListViewItem listViewItem in listViewFilters.CheckedItems) { int filter = (int)listViewItem.Tag; _mouse.AddToLocateFilter(filter); } _mouse.MouseDown += mouse_MouseDown; _mouse.MouseMove += mouse_MouseMove; outputTextBox.Clear(); comboBoxEnableMouseMoveEvent.Enabled = false; buttonStopCommand.Enabled = true; buttonStartCommand.Checked = true; buttonStartCommand.Enabled = false; comboBoxLocateModes.Enabled = false; listViewFilters.Enabled = false; } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Creates a Solid Edge command control. /// </summary> /// <param name="application"></param> /// <param name="CmdFlags"></param> public static SolidEdgeFramework.Command CreateCommand(this SolidEdgeFramework.Application application, SolidEdgeConstants.seCmdFlag CmdFlags) { return(application.CreateCommand((int)CmdFlags)); }