简体   繁体   中英

Get system with elements from a model

How do I get the elements in a HVAC system? I can access the list of the systems in a model with the following code:

var systems = model.Instances.OfType<IfcSystem>();

This returns a list of all the systems in the model. How to access the elements in a system?

So this is a matter of understanding the IFC data model by looking at the standards - in particular the Group Assignment data model: https://standards.buildingsmart.org/IFC/RELEASE/IFC4_1/FINAL/HTML/link/group-assignment.htm

In IFC, an IfcSystem subclasses IfcGroup . To get the members of a Group you need to access the IfcRelAssignsToGroup relationship provided via IsGroupedBy , from where you can get the RelatedObjects collection containing the actual elements.

So in xbim you'd end up with something like:

var hvacSystem = model.Instances.OfType<IfcSystem>().First(s => s.GlobalId="<Your Hvac Identifier>");

var hvacElements = hvacSystem.IsGroupedBy?.RelatedObjects.OfType<IIfcProduct>();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM