maintain snake in api calls

there were only two methods using camel case for arguments
This commit is contained in:
Andrej730
2024-05-13 17:51:19 +05:00
parent 4e39fb3edd
commit fdbe74a432
19 changed files with 127 additions and 27 deletions
@@ -19,7 +19,7 @@ import ifcopenshell
from typing import Optional
def add_layer(file: ifcopenshell.file, Name: Optional[str] = None) -> ifcopenshell.entity_instance:
def add_layer(file: ifcopenshell.file, name: str = "Unnamed") -> ifcopenshell.entity_instance:
"""Adds a new layer
An IFC layer is like a CAD layer. Portions of an object's geometry
@@ -34,13 +34,13 @@ def add_layer(file: ifcopenshell.file, Name: Optional[str] = None) -> ifcopenshe
Some software that are still based on layers, such as Tekla or ArchiCAD
may also use this layer information for filtering.
:param Name: The name of the layer. Defaults to "Unnamed".
:type Name: str, optional
:param name: The name of the layer. Defaults to "Unnamed".
:type name: str, optional
:return: The newly created IfcPresentationLayerAssignment element
:rtype: ifcopenshell.entity_instance
Example:
ifcopenshell.api.run("layer.add_layer", model, Name="AI-WALL-FULL-DIMS-N")
ifcopenshell.api.run("layer.add_layer", model, name="AI-WALL-FULL-DIMS-N")
"""
return file.create_entity("IfcPresentationLayerAssignment", Name=Name or "Unnamed")
return file.create_entity("IfcPresentationLayerAssignment", Name=name)
@@ -59,7 +59,7 @@ def assign_layer(
ifcopenshell.api.run("geometry.edit_object_placement", model, product=wall)
# Now let's create a layer that contains walls
layer = ifcopenshell.api.run("layer.add_layer", model, Name="AI-WALL")
layer = ifcopenshell.api.run("layer.add_layer", model, name="AI-WALL")
# And assign our wall representation item (in this example, there is
# only one item) to the layer.
@@ -36,7 +36,7 @@ def edit_layer(file: ifcopenshell.file, layer: ifcopenshell.entity_instance, att
.. code:: python
layer = ifcopenshell.api.run("layer.add_layer", model, Name="AI-WALL")
layer = ifcopenshell.api.run("layer.add_layer", model, name="AI-WALL")
ifcopenshell.api.run("layer.edit_layer", model,
layer=layer, attributes={"Description": "All walls, based on the AIA standard."})
"""
@@ -33,7 +33,7 @@ def remove_layer(file: ifcopenshell.file, layer: ifcopenshell.entity_instance) -
.. code:: python
layer = ifcopenshell.api.run("layer.add_layer", model, Name="AI-WALL")
layer = ifcopenshell.api.run("layer.add_layer", model, name="AI-WALL")
ifcopenshell.api.run("layer.remove_layer", model, layer=layer)
"""
file.remove(layer)
@@ -56,7 +56,7 @@ def unassign_layer(
ifcopenshell.api.run("geometry.edit_object_placement", model, product=wall)
# Now let's create a layer that contains walls
layer = ifcopenshell.api.run("layer.add_layer", model, Name="AI-WALL")
layer = ifcopenshell.api.run("layer.add_layer", model, name="AI-WALL")
# And assign our wall representation item (in this example, there is
# only one item) to the layer.