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

Function get_assembly_data

src/ifcfm/ifcfm/cobie24.py:646–679  ·  view source on GitHub ↗
(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance)

Source from the content-addressed store, hash-verified

644
645
646def get_assembly_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:
647 rel, relating_object, related_object = element
648
649 if relating_object.is_a("IfcMaterialLayerSet"):
650 name = val(relating_object.LayerSetName)
651 parent_name = name
652 if name:
653 name += " assembly"
654 assembly_type = "Layer"
655 sheet_name = "Type"
656 description = val(relating_object.LayerSetName)
657 else:
658 name = val(relating_object.Name)
659 parent_name = name
660 assembly_type = "Fixed"
661 sheet_name = get_sheet_name(relating_object)
662 description = val(rel.Description) or val(rel.Name)
663
664 child_name = val(related_object.Name)
665 history = get_history(ifc_file)
666
667 return {
668 "Name": name,
669 "CreatedBy": get_email_from_history(history) if history else None,
670 "CreatedOn": ifcopenshell.util.date.ifc2datetime(history.CreationDate).isoformat() if history else None,
671 "SheetName": sheet_name,
672 "ParentName": parent_name,
673 "ChildNames": child_name,
674 "AssemblyType": assembly_type,
675 "ExternalSystem": history.OwningApplication.ApplicationFullName if history else None,
676 "ExternalObject": rel.is_a() if rel else relating_object.is_a(),
677 "ExternalIdentifier": rel.GlobalId if rel else None,
678 "Description": description,
679 }
680
681
682def 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