Group: Forum Members
Last Active: 13 Years Ago
Posts: 25,
Visits: 1
|
I am trying to create the connection between two vertices. I am listening to the EventSinkService_Connecting and trying to get the connecting nodes out of the NConnectionCancelEventArgs. How can I get the newly create Edge so I can get the From and To nodes?
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Luis, in the Connecting event you can easily get the ports being connected: NPort port1 = (NPort)document.GetElementFromUniqueId(args.UniqueId1); NPort port2 = (NPort)document.GetElementFromUniqueId(args.UniqueId2); Next you can use the Shape property of the port to get the shape.
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 25,
Visits: 1
|
Thank you, I am almost there. Now that I have the two nodes, I can do my logic and if it doesn't pass I need to cancel the connection. However, when I set the args.Cancel = true, the Connected event doesn't get fired, great, but the line still draws on the document. How can I tell the I try to call Abort and Disactivate on the connector but it didn't work. Thanks much!!!
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 25,
Visits: 1
|
Nevermind, I found a work around
|