Hello,
When I export from Grasshopper using ggIFC space, I get space names when checking on Solibri. However, when I try to extract the space name using ifcopenshell in python, the space names all return “none”.
def extract_properties(entity):
"""Extracts general properties and quantities from an IFC entity."""
data = {
"GlobalId": entity.GlobalId,
"Name": entity.Name,
"Description": getattr(entity, "Description", None),
"ObjectType": getattr(entity, "ObjectType", None),
"IfcType": entity.is_a()
}
if hasattr(entity, "IsDefinedBy"):
for rel in entity.IsDefinedBy:
if rel.is_a("IfcRelDefinesByProperties") and hasattr(rel, "RelatingPropertyDefinition"):
prop_def = rel.RelatingPropertyDefinition
if prop_def.is_a("IfcPropertySet"):
for prop in prop_def.HasProperties:
if prop.is_a("IfcPropertySingleValue"):
data[prop.Name] = getattr(prop.NominalValue, 'wrappedValue', None)
elif prop_def.is_a("IfcElementQuantity"):
for quantity in prop_def.Quantities:
for attr in ["LengthValue", "AreaValue", "VolumeValue"]:
if hasattr(quantity, attr):
value = getattr(quantity, attr)
data[quantity.Name] = (
value.wrappedValue
if hasattr(value, "wrappedValue")
else value
)
return data
Any suggestions appreciated.
Reinhardt