Write docs for owner API module

This commit is contained in:
Dion Moult
2022-12-14 15:58:31 +11:00
parent 05cd11ae12
commit a5a1ef2e8e
24 changed files with 696 additions and 103 deletions
@@ -16,15 +16,26 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell.api
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, application=None):
"""Removes an application
Warning: removing an application may invalidate ownership histories.
Check whether or not the application is used anywhere prior to removal.
:param address: The IfcApplication to remove.
:type address: ifcopenshell.entity_instance.entity_instance
:return: None
:rtype: None
Example::
application = ifcopenshell.api.run("owner.add_application", model)
ifcopenshell.api.run("owner.remove_address", model, application=application)
"""
self.file = file
self.settings = {"application": None}
for key, value in settings.items():
self.settings[key] = value
self.settings = {"application": application}
def execute(self):
self.file.remove(self.settings["application"])