List property set, property names and element types that have this
How is it possible to list all property set, property names and element types that have this in ifc file using IfcOpenShell Python. End result should be something like this
My code so far
Tagged:
Comments
Got the loop working, but still I do not know how to get property data type. Also if property set is attached to multiple ifc types would like to get result like this
AR_001-002(IfcColumn, IfcRailing )
001_Nimetus
002_Tüüp
At the moment get result like this
AR_001-002(IfcColumn)
001_Nimetus
002_Tüüp
AR_001-002(IfcRailing)
001_Nimetus
002_Tüüp
Code so war
Hi @lraimo, I have edited your post to show the code properly. You can use three quotes (```) above and below to do so.
Look also this thread that is similar.
ifcopenshell.util.element
has functions that can help you get the property setsProperty types can be retrieved either through the property template definition, or the stored nominal value attribute. Try
property.NominalValue
, as well asproperty.NominalValue.attribute_type(0)
, orproperty.NominalValue.is_a()
, ortype(property.NominalValue.wrappedValue)
depending on what you're after.property.NominalValue.is_a()
was what I needed. Thanks.property.NominalValue
I get IfcText('Curtain Wall').property.NominalValue.wrappedValue
I get Curtain Wall.property.NominalValue.is_a()
I get IfcText.property.NominalValue.attribute_type(0)
did not work.With code
for IfcType in ifc_file.types_with_super()
I get IFC Element, sample value IfcSlabBut there also is
IfcElementType , sample value IfcSlabType
PredefinedType, sample value ROOF
Is it possible to get those values by Python IfcOpenShell?
It sounds like you want to query the schema, not an individual file. This has been documented to an extent here: https://wiki.osarch.org/index.php?title=IfcOpenShell_code_examples#Exploring_IFC_schema
No I want to get IfcElement (for example IfcSlab), IfcElementType (for example IfcSlabType), and PredefinedType ( for example Roof) for all PropertySets in IfcFile. I found a way how to get IfcElement and PredefinedType, but have not found a way to get IfcElementType.
My code:
Seems that both IfcElement and IfcElementType can be obtained with

ifc_file.by_type()
. But there should be connection between them because in viewer both are connected to one element.Try:
That worked, thanks