mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
IfcTester now supports list and enumerated properties
This commit is contained in:
@@ -95,9 +95,9 @@ def get_properties(properties):
|
||||
if prop.is_a("IfcPropertySingleValue"):
|
||||
results[prop.Name] = prop.NominalValue.wrappedValue if prop.NominalValue else None
|
||||
elif prop.is_a("IfcPropertyEnumeratedValue"):
|
||||
values = [v.wrappedValue for v in prop.EnumerationValues]
|
||||
results[prop.Name] = [v.wrappedValue for v in prop.EnumerationValues] or None
|
||||
|
||||
elif prop.is_a("IfcPropertyListValue"):
|
||||
results[prop.Name] = [v.wrappedValue for v in prop.ListValues] or None
|
||||
elif prop.is_a("IfcComplexProperty"):
|
||||
data = {k: v for k, v in prop.get_info().items() if v is not None and k != "Name"}
|
||||
data["properties"] = get_properties(prop.HasProperties)
|
||||
|
||||
@@ -337,6 +337,10 @@ def get_property_unit(prop, ifc_file):
|
||||
measure_class = entity.attribute_by_index(3).type_of_attribute().declared_type().name()
|
||||
elif prop.is_a("IfcPropertySingleValue") and prop.NominalValue:
|
||||
measure_class = prop.NominalValue.is_a()
|
||||
elif prop.is_a("IfcPropertyEnumeratedValue") and prop.EnumerationValues:
|
||||
measure_class = prop.EnumerationValues[0].is_a()
|
||||
elif prop.is_a("IfcPropertyListValue") and prop.ListValues:
|
||||
measure_class = prop.ListValues[0].is_a()
|
||||
unit_type = get_measure_unit_type(measure_class)
|
||||
units = [u for u in unit_assignment.Units if getattr(u, "UnitType", None) == unit_type]
|
||||
if units:
|
||||
|
||||
Reference in New Issue
Block a user