Write docs for style API module

This commit is contained in:
Dion Moult
2023-01-04 16:09:16 +11:00
parent 9e45435024
commit b86818ead3
9 changed files with 414 additions and 44 deletions
@@ -20,11 +20,26 @@ import ifcopenshell.util.element
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, style=None):
"""Removes a presentation style
All of the presentation items of the style will also be removed.
:param style: The IfcPresentationStyle to remove.
:type style: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: None
Example::
# Create a new surface style
style = ifcopenshell.api.run("style.add_style", model)
# Not anymore!
ifcopenshell.api.run("style.remove_style", model, style=style)
"""
self.file = file
self.settings = {"style": None}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"style": style}
def execute(self):
self.purge_styled_items(self.settings["style"])