Profile Picture

NConnectorTool

Posted By Luis Mendes 14 Years Ago
Author
Message
Luis Mendes
Posted 14 Years Ago
View Quick Profile
Forum Member

Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)

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?

Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

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



Luis Mendes
Posted 14 Years Ago
View Quick Profile
Forum Member

Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)

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!!!

Luis Mendes
Posted 14 Years Ago
View Quick Profile
Forum Member

Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 25, Visits: 1

Nevermind, I found a work around





Similar Topics


Reading This Topic