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

Function get_connection_data

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

Source from the content-addressed store, hash-verified

680
681
682def get_connection_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:
683 connection_type = (
684 val(element.RelatingPort.ObjectType)
685 or val(element.RelatedPort.ObjectType)
686 or val(element.Description)
687 or val(element.Name)
688 )
689 name = val(element.Name)
690 row_name1 = val(ifcopenshell.util.system.get_port_element(element.RelatingPort).Name)
691 row_name2 = val(ifcopenshell.util.system.get_port_element(element.RelatedPort).Name)
692 return {
693 "Name": name,
694 "CreatedBy": get_created_by(element),
695 "CreatedOn": get_created_on(element),
696 "ConnectionType": connection_type,
697 "SheetName": "Component",
698 "RowName1": row_name1,
699 "RowName2": row_name2,
700 "RealizingElement": val(element.RealizingElement.Name) if element.RealizingElement else None,
701 "PortName1": val(element.RelatingPort.Name),
702 "PortName2": val(element.RelatedPort.Name),
703 "ExternalSystem": get_external_system(element),
704 "ExternalObject": element.is_a(),
705 "ExternalIdentifier": element.GlobalId,
706 "Description": val(element.Description) or val(element.Name),
707 }
708
709
710def get_spare_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:

Callers

nothing calls this directly

Calls 5

valFunction · 0.70
get_created_byFunction · 0.70
get_created_onFunction · 0.70
get_external_systemFunction · 0.70
is_aMethod · 0.45

Tested by

no test coverage detected