Add API docs for constraint module

This commit is contained in:
Dion Moult
2022-11-16 08:56:55 +09:00
parent ff2714d991
commit 22b4bfe07d
8 changed files with 159 additions and 33 deletions
@@ -18,14 +18,24 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, product=None, constraint=None):
"""Unassigns a constraint to a product
The constraint will not be deleted and is available to be assigned to
other products.
:param product: The product the constraint applies to.
:type product: ifcopenshell.entity_instance.entity_instance
:param constraint: The IfcObjective constraint
:type constraint: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: None
"""
self.file = file
self.settings = {
"product": None,
"constraint": None,
"product": product,
"constraint": constraint,
}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
for rel in self.settings["product"].HasAssociations: