mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Merge pull request #7576 from falken10vdl/support-enum-for-search-suggestions
Enhance filter value suggestions to support enumerated properties in search
This commit is contained in:
@@ -445,20 +445,17 @@ class FilterValueSuggestions(Operator):
|
|||||||
if pset.HasProperties:
|
if pset.HasProperties:
|
||||||
for prop in pset.HasProperties:
|
for prop in pset.HasProperties:
|
||||||
if hasattr(prop, "Name") and prop.Name == property_name:
|
if hasattr(prop, "Name") and prop.Name == property_name:
|
||||||
if hasattr(prop, "NominalValue") and prop.NominalValue:
|
if prop.is_a("IfcPropertyEnumeratedValue"):
|
||||||
try:
|
if hasattr(prop, "EnumerationReference") and prop.EnumerationReference:
|
||||||
value = prop.NominalValue.wrappedValue
|
enum_reference = prop.EnumerationReference
|
||||||
if value is not None and value != "":
|
if hasattr(enum_reference, "EnumerationValues"):
|
||||||
if not hasattr(value, "is_a") and not isinstance(
|
for enum_value in enum_reference.EnumerationValues:
|
||||||
value, (tuple, list)
|
property_values.add(str(enum_value.wrappedValue))
|
||||||
):
|
if hasattr(prop, "EnumerationValues") and prop.EnumerationValues:
|
||||||
str_value = str(value)
|
for enum_value in prop.EnumerationValues:
|
||||||
if not str_value.startswith("#") and not str_value.startswith(
|
property_values.add(str(enum_value.wrappedValue))
|
||||||
"("
|
elif hasattr(prop, "NominalValue") and prop.NominalValue:
|
||||||
):
|
property_values.add(str(prop.NominalValue.wrappedValue))
|
||||||
property_values.add(str_value)
|
|
||||||
except:
|
|
||||||
continue
|
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
return property_values
|
return property_values
|
||||||
|
|||||||
Reference in New Issue
Block a user