Add docs for library API module

This commit is contained in:
Dion Moult
2022-12-07 12:20:29 +11:00
parent 9650bbb5ee
commit 7da3d9ee70
8 changed files with 213 additions and 35 deletions
@@ -18,11 +18,24 @@
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, library=None):
"""Removes a library
All references along with their relationships will also be removed. Any
products which have relationships to this library will not be removed.
:param library: The IfcLibraryInformation entity you want to remove
:type library: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: None
Example::
library = ifcopenshell.api.run("library.add_library", model, name="Brickschema")
ifcopenshell.api.run("library.remove_library", model, library=library)
"""
self.file = file
self.settings = {"library": None}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"library": library}
def execute(self):
for reference in set(self.settings["library"].HasLibraryReferences or []):