ifcopenshell.api.system.unassign_port#

Module Contents#

class ifcopenshell.api.system.unassign_port.Usecase(file, element=None, port=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
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)
execute(self)#
execute_ifc2x3(self)#