XbimEssentials icon indicating copy to clipboard operation
XbimEssentials copied to clipboard

Getting names for qantities and properties

Open GVladislavG opened this issue 2 years ago • 3 comments

Hello, xBim team!

I need to get quantitties and properties names for any IFC-class (any IPersistEntitty) in my code. All the quantitties and properties names like they are named in docs (for example IfcFooting https://standards.buildingsmart.org/IFC/RELEASE/IFC4_1/FINAL/HTML/schema/ifcstructuralelementsdomain/lexical/ifcfooting.htm)

But I have to do it without any IFC-file with filled properties and quantities. If I just create Entity of every class, properties and quantities are empty. Please tell and show is there any way to do this?

Thank you!

GVladislavG avatar Jul 12 '21 12:07 GVladislavG

Yes, there is an easy way to do this with xbim. All IFC properties and quantities are published in several formats. And one of these formats is IFC Property Templates!

So, the easiest thing to do is to open this file with xbim and search for all IfcPropertySetTemplates.

Caveat: It is used for both property sets and quantity sets.

martin1cerny avatar Jul 12 '21 13:07 martin1cerny

Thanks! And also similar question. How can I get tree of all IFC-classes (for IFC2x3 and IFC4)? In this case I need only names of the classes?

GVladislavG avatar Jul 12 '21 17:07 GVladislavG

Just use reflection. You can also use our pre-computed IFC metadata:

var root = typeof(IfcProduct); 
var metadata = ExpressMetaData.GetMetadata(root.Assembly.Modules.First());

martin1cerny avatar Jul 13 '21 08:07 martin1cerny