Nevron Forum

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

https://www.nevron.com/Forum/Topic3969.aspx

By Balasaheb Sherkar 1 - Wednesday, August 11, 2010

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

By Nevron Support - Wednesday, August 11, 2010

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;

}