mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-13 06:53:36 +00:00
fix #5047 - order IfcAnnotationTypes alphabetically.
and order types regardless of case.
This commit is contained in:
@@ -410,6 +410,7 @@ class AnnotationData:
|
|||||||
|
|
||||||
results = [("0", "Untyped", "")]
|
results = [("0", "Untyped", "")]
|
||||||
results.extend([(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in relating_types])
|
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
|
return results
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ class AuthoringData:
|
|||||||
if not ifc_class and ifc_classes:
|
if not ifc_class and ifc_classes:
|
||||||
ifc_class = ifc_classes[0][0]
|
ifc_class = ifc_classes[0][0]
|
||||||
if ifc_class:
|
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)
|
results.extend(elements)
|
||||||
return [(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in results]
|
return [(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in results]
|
||||||
return []
|
return []
|
||||||
|
|||||||
Reference in New Issue
Block a user