MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_assembly_data

Function get_assembly_data

src/ifcfm/ifcfm/cobie24legacy.py:707–741  ·  view source on GitHub ↗
(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance)

Source from the content-addressed store, hash-verified

705
706
707def get_assembly_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:
708 rel, relating_object, related_object = element
709
710 if relating_object.is_a("IfcMaterialLayerSet"):
711 name = val(relating_object.LayerSetName)
712 parent_name = name
713 if name:
714 name += " assembly"
715 assembly_type = "Layer"
716 sheet_name = "Type"
717 description = val(relating_object.LayerSetName)
718 else:
719 name = val(relating_object.Name)
720 parent_name = name
721 assembly_type = "Fixed"
722 sheet_name = get_sheet_name(relating_object)
723 description = val(rel.Description) or val(rel.Name)
724
725 child_name = val(related_object.Name)
726 history = get_history(ifc_file)
727
728 return {
729 "key": str(name) + str(sheet_name) + str(parent_name),
730 "Name": name,
731 "CreatedBy": get_email_from_history(history) if history else None,
732 "CreatedOn": ifcopenshell.util.date.ifc2datetime(history.CreationDate).isoformat() if history else None,
733 "SheetName": sheet_name,
734 "ParentName": parent_name,
735 "ChildNames": child_name,
736 "AssemblyType": assembly_type,
737 "ExternalSystem": history.OwningApplication.ApplicationFullName if history else None,
738 "ExternalObject": rel.is_a() if rel else relating_object.is_a(),
739 "ExternalIdentifier": rel.GlobalId if rel else None,
740 "Description": description,
741 }
742
743
744def get_connection_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:

Callers

nothing calls this directly

Calls 5

valFunction · 0.70
get_sheet_nameFunction · 0.70
get_historyFunction · 0.70
get_email_from_historyFunction · 0.70
is_aMethod · 0.45

Tested by

no test coverage detected