mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Write docs for system API module
This commit is contained in:
@@ -21,14 +21,38 @@ import ifcopenshell.api
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
def __init__(self, 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.
|
||||
|
||||
:param element: The IfcDistributionElement to unassign the port from.
|
||||
:type element: ifcopenshell.entity_instance.entity_instance
|
||||
:param port: The IfcDistributionPort you want to unassign.
|
||||
:type port: ifcopenshell.entity_instance.entity_instance
|
||||
:return: None
|
||||
:rtype: 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)
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"element": None,
|
||||
"port": None,
|
||||
"element": element,
|
||||
"port": port,
|
||||
}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
|
||||
def execute(self):
|
||||
if self.file.schema == "IFC2X3":
|
||||
|
||||
Reference in New Issue
Block a user