///
<summary>
/// Get all the connectors of a specific element
/// </summary>
/// <param name="element"> the owner of the connector </param>
/// <returns> if found, return all the connectors found, or else return null </returns>
public static ConnectorSet GetConnectors(Autodesk.Revit.DB.Element element)
{
if (element == null ) return null ;
FamilyInstance fi = element as FamilyInstance;
if (fi != null && fi.MEPModel != null )
{
return fi.MEPModel.ConnectorManager.Connectors;
}
MEPSystem system = element as MEPSystem;
if (system != null )
{
return system.ConnectorManager.Connectors;
}
MEPCurve duct = element as MEPCurve;
if (duct != null )
{
return duct.ConnectorManager.Connectors;
}
return null ;
}
/// Get all the connectors of a specific element
/// </summary>
/// <param name="element"> the owner of the connector </param>
/// <returns> if found, return all the connectors found, or else return null </returns>
public static ConnectorSet GetConnectors(Autodesk.Revit.DB.Element element)
{
if (element == null ) return null ;
FamilyInstance fi = element as FamilyInstance;
if (fi != null && fi.MEPModel != null )
{
return fi.MEPModel.ConnectorManager.Connectors;
}
MEPSystem system = element as MEPSystem;
if (system != null )
{
return system.ConnectorManager.Connectors;
}
MEPCurve duct = element as MEPCurve;
if (duct != null )
{
return duct.ConnectorManager.Connectors;
}
return null ;
}