Message 1 of 2
Highligt Tangentially Connected edges on PreSelect in C#

Not applicable
03-18-2011
08:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Based on the "interactive selection" example in the programmers help, i have tried to implement the highligting og Tangentially connected edges in the OnPreSelect Event. I have followed the sample VB code, however it still doesn't work. I am no getting any error messages, but the tangentially connected edges are not highlighted. What am i doing wrong? Here's the code:
public override void OnPreSelect(object preSelectEntity, out bool doHighlight, ObjectCollection morePreSelectEntities, SelectionDeviceEnum selectionDevice, Point modelPosition, Point2d viewPosition, Inventor.View view) { doHighlight = true; try { if (preSelectEntity is Edge) { Edge preSelectEdge = (Edge)preSelectEntity; EdgeCollection TangentiallyConnected = preSelectEdge.TangentiallyConnectedEdges; int ntangents = TangentiallyConnected.Count; if (ntangents > 1) { morePreSelectEntities = m_application.TransientObjects.CreateObjectCollection(null); for (int n = 1; n <= ntangents; n++) { if (TangentiallyConnected[n] != preSelectEdge) { morePreSelectEntities.Add((object)TangentiallyConnected[n]); } } } doHighlight = true; } else { doHighlight = false; } } catch (Exception e) { doHighlight = false; System.Windows.Forms.MessageBox.Show(e.ToString()); } }
I have checked and verified that the "TangentiallyConnectedEdges" property does indeed have tangentially connected edges, and i can access each of them, but they just won't show up highlighted inside Inventor.
Hope someone has a suggestion! I would really appreciate it!
/ Dan