private void mSelectEvents_OnSelect(Inventor.ObjectsEnumerator JustSelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View) { if (JustSelectedEntities.Count != 0) { object selectedObj = JustSelectedEntities[1]; System.Windows.Forms.MessageBox.Show((string)("Selected Entity: " + Information.TypeName(selectedObj)), "Simple Interaction"); } }
void SelectEvents_OnSelect( Inventor.ObjectsEnumerator JustSelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View) { if (_state == CommandState.Idle) { return; } if (JustSelectedEntities.Count != 1) { return; } if (!(JustSelectedEntities[1] is ComponentOccurrence)) { return; } ComponentOccurrence selectedOccurrence = JustSelectedEntities[1] as ComponentOccurrence; switch (_state) { case CommandState.SourceComponentSelection: if (_targetComponent != null) { if (selectedOccurrence.Definition == _targetComponent.Definition) { System.Windows.Forms.MessageBox.Show("Source and Target components cannot be the same, or refer to the same document...", "Error selecting component", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); break; } } _state = CommandState.Idle; _sourceComponent = selectedOccurrence; SourceComponentSelected(this, new EventArgs()); break; case CommandState.TargetComponentSelection: if (_sourceComponent != null) { if (selectedOccurrence.Definition == _sourceComponent.Definition) { System.Windows.Forms.MessageBox.Show("Source and Target components cannot be the same, or refer to the same document...", "Error selecting component", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); break; } } _state = CommandState.Idle; _targetComponent = selectedOccurrence; TargetComponentSelected(this, new EventArgs()); break; default: _state = CommandState.Idle; break; } }
private void m_SelectEvents_OnSelect(Inventor.ObjectsEnumerator JustSelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View) { if (JustSelectedEntities.Count != 0) { object selectObj1 = JustSelectedEntities[1]; //object selectObj2 = JustSelectedEntities[2]; System.Windows.Forms.MessageBox.Show((string)("Selected Entity Type: " + Information.TypeName(selectObj1)) + " , Interactive selection successful!", "Interactive Selection"); } }
private void OnPreSelect(ref object PreSelectEntity, out bool DoHighlight, ref Inventor.ObjectCollection MorePreSelectEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View) { if (PreSelectEntity is SurfaceGraphicsFace) { DoHighlight = true; } else { DoHighlight = false; } }
private void m_SelectEvents_OnSelect(Inventor.ObjectsEnumerator JustSelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View) { //reserved for future }