mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
Fix very old bug with IfcPersonAndOrganization enum not loading (6ce8a36)
This commit is contained in:
@@ -188,7 +188,14 @@ class ActorData:
|
|||||||
props = tool.Owner.get_owner_props()
|
props = tool.Owner.get_owner_props()
|
||||||
if not (ifc_class := props.actor_type):
|
if not (ifc_class := props.actor_type):
|
||||||
ifc_class = cls.actor_type()[0][0]
|
ifc_class = cls.actor_type()[0][0]
|
||||||
return [(str(p.id()), p[0] or "Unnamed", "") for p in tool.Ifc.get().by_type(ifc_class)]
|
|
||||||
|
def get_name(entity: ifcopenshell.entity_instance) -> str:
|
||||||
|
if entity.is_a() == "IfcPersonAndOrganization":
|
||||||
|
return f"{get_name(entity.ThePerson)}/{get_name(entity.TheOrganization)}"
|
||||||
|
# 0 IfcPerson/IfcOrganization Id(IFC2X3)/Identification
|
||||||
|
return entity[0] or "Unnamed"
|
||||||
|
|
||||||
|
return [(str(p.id()), get_name(p), "") for p in tool.Ifc.get().by_type(ifc_class)]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def actors(cls) -> list[dict[str, Any]]:
|
def actors(cls) -> list[dict[str, Any]]:
|
||||||
|
|||||||
Reference in New Issue
Block a user