通过MEPModel主要用来找到连接器
/// <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 == nullreturn 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;
}
from:http://revit.5d6d.com/thread-847-1-4.html

相关文章:

  • 2021-04-11
  • 2022-12-23
  • 2021-12-18
  • 2021-08-03
  • 2022-01-11
  • 2022-02-09
  • 2021-05-27
  • 2022-02-17
猜你喜欢
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案