fix #5047 - order IfcAnnotationTypes alphabetically.

and order types regardless of case.
This commit is contained in:
Ryan Schultz
2024-07-20 13:02:21 -05:00
parent ab97f23b47
commit 05e202059e
2 changed files with 2 additions and 1 deletions
@@ -410,6 +410,7 @@ class AnnotationData:
results = [("0", "Untyped", "")]
results.extend([(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in relating_types])
results.sort(key=lambda x: x[1].lower())
return results
@classmethod
@@ -245,7 +245,7 @@ class AuthoringData:
if not ifc_class and ifc_classes:
ifc_class = ifc_classes[0][0]
if ifc_class:
elements = sorted(tool.Ifc.get().by_type(ifc_class), key=lambda s: s.Name or "Unnamed")
elements = sorted(tool.Ifc.get().by_type(ifc_class), key=lambda s: (s.Name or "Unnamed").lower())
results.extend(elements)
return [(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in results]
return []