Get Connectors from MEPCurve objects

Get Connectors from MEPCurve objects

The following function retrieves connectors from Pipe, Duct, CableTrayConduitBase, FlexPipe, FlexDuct, Wire and Insulation class objects, since they were derived from the MEPCurve class.

//Input MEPCurve object, e.g. Pipe, Duct, CableTray, Wire
//Function returns list of connectors from MEPCurve object
public List<ConnectorGetConnectors(MEPCurve mepCurve)
{
    //1. Get connector set of MEPCurve
    ConnectorSet connectorSet = mepCurve.ConnectorManager.Connectors;
    //2. Initialise empty list of connectors
    List<Connector> connectorList = new List<Connector>();
    //3. Loop through connector set and add to list
    foreach (Connector connector in connectorSet)
    {
        connectorList.Add(connector);
    }
    return connectorList;
}

Retrieve connectors from instance MEPModel objects can be found here! The source code for the full implementation above can be foundĀ HERE! Happy coding!

This Post Has 2 Comments

  1. Hello,How can retrieve the reference level in the pipes and add SchedulesTable.
    Sorry,my english is basic

    1. Hi Reynaldo,

      Have you tried getting it from the “Offset” parameter, using LookUpParameter(“Offset”) Method?
      I’m not sure what SchedulesTable refer to though… Can you illustrate it?

      regards,
      Han

Leave a Reply

Close Menu