Profile Picture

how get reference to Ports of Shape ? & list out how many NRoutableConnector node are connected to...

Posted By Balasaheb 14 Years Ago

how get reference to Ports of Shape ? & list out how many...

Author
Message
Balasaheb
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 6, Visits: 1

hi

i have one  shape with bound port, it is used to connect to multipele shape.

i want to list out NRoutableConnector node that are connected to that bound port .

please reply



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,

To get the shape connected to a given port you can use the following code:

 

private List<NShape> GetConnectors(NPort port)

{

      NNodeList plugs = port.Plugs;

      if (plugs == null)

            return new List<NShape>();

 

      List<NShape> connectors = new List<NShape>();

      for (int i = 0, count = plugs.Count; i < count; i++)

      {

            NPlug plug = (NPlug)plugs[i];

            connectors.Add(plug.Shape);

      }

 

      return connectors;

}

 



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic