ifcopenshell.api.system.unassign_port
¶
Module Contents¶
- ifcopenshell.api.system.unassign_port.unassign_port(file, element=None, port=None) None ¶
Unassigns a port to an element
Ports are typically always assigned to a distribution element, but in some edge cases you may want to unassign the port to create an orphaned port for cleaning or patchin purposes.
- Parameters:
element (ifcopenshell.entity_instance) – The IfcDistributionElement to unassign the port from.
port (ifcopenshell.entity_instance) – The IfcDistributionPort you want to unassign.
- Returns:
None
- Return type:
None
Example:
# Create a duct duct = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcDuctSegment", predefined_type="RIGIDSEGMENT") # Create 2 ports, one for either end. port1 = ifcopenshell.api.run("system.add_port", model, element=duct) port2 = ifcopenshell.api.run("system.add_port", model, element=duct) # Unassign one port for some weird reason. ifcopenshell.api.run("system.unassign_port", model, element=duct, port=port1)