mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Write documentation for structural API module
This commit is contained in:
@@ -20,14 +20,32 @@ import ifcopenshell.api
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
def __init__(self, file, name=None, ifc_class="IfcStructuralLoadLinearForce"):
|
||||
"""Adds a new structural load
|
||||
|
||||
Structural loads may be actions or reactions. A simple load might be a
|
||||
static and be linear, planar, or a single point. Alternatively, loads
|
||||
may be defined as a configuration of multiple loads.
|
||||
|
||||
:param name: The name of the load
|
||||
:type name: str,optional
|
||||
:param ifc_class: The subtype of IfcStructuralLoad to create. Consult
|
||||
the IFC documentation to see all the types of loads.
|
||||
:type ifc_class: str
|
||||
:return: The newly created load entity, depending on the ifc_class
|
||||
specified.
|
||||
:rtype: ifcopenshell.entity_instance.entity_instance
|
||||
|
||||
Example::
|
||||
|
||||
# Create a simple linear load
|
||||
ifcopenshell.api.run("structural.add_structural_load", model)
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"name": None,
|
||||
"ifc_class": "IfcStructuralLoadLinearForce",
|
||||
"name": name,
|
||||
"ifc_class": ifc_class,
|
||||
}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
|
||||
def execute(self):
|
||||
return self.file.create_entity(self.settings["ifc_class"], Name=self.settings["name"])
|
||||
|
||||
Reference in New Issue
Block a user