Add documentation for pset API module

This commit is contained in:
Dion Moult
2022-12-15 16:02:27 +11:00
parent 241406f676
commit 0ccea3cef8
6 changed files with 392 additions and 40 deletions
@@ -18,11 +18,29 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, product=None, pset=None):
"""Removes a property set from a product
All properties that are part of this property set are also removed.
:param product: The IfcObject to remove the property set from.
:type product: ifcopenshell.entity_instance.entity_instance
:param pset: The IfcPropertySet or IfcElementQuantity to remove.
:type pset: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: None
Example::
# Let's imagine we have a new wall type with a property set.
wall_type = ifcopenshell.api.run("root.create_entity", model, ifc_class="IfcWallType")
pset = ifcopenshell.api.run("pset.add_pset", model, product=wall_type, name="Pset_WallCommon")
# Remove it!
ifcopenshell.api.run("pset.remove_pset", model, product=wall_type, pset=pset)
"""
self.file = file
self.settings = {"product": None, "pset": None}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"product": product, "pset": pset}
def execute(self):
to_purge = []