mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix #1462. Standardise IfcOpenShell API to use Pythonic argument names.
This commit is contained in:
@@ -2,20 +2,20 @@ class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"AxisTag": "A",
|
||||
"SameSense": True,
|
||||
"UVWAxes": "UAxes", # Choose which axes
|
||||
"Grid": None,
|
||||
"axis_tag": "A",
|
||||
"same_sense": True,
|
||||
"uvw_axes": "UAxes", # Choose which axes
|
||||
"grid": None,
|
||||
}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
|
||||
def execute(self):
|
||||
element = self.file.create_entity("IfcGridAxis", **{
|
||||
"AxisTag": self.settings["AxisTag"],
|
||||
"SameSense": self.settings["SameSense"]
|
||||
"axis_tag": self.settings["axis_tag"],
|
||||
"SameSense": self.settings["same_sense"]
|
||||
})
|
||||
axes = list(getattr(self.settings["Grid"], self.settings["UVWAxes"]) or [])
|
||||
axes = list(getattr(self.settings["grid"], self.settings["uvw_axes"]) or [])
|
||||
axes.append(element)
|
||||
setattr(self.settings["Grid"], self.settings["UVWAxes"], axes)
|
||||
setattr(self.settings["grid"], self.settings["uvw_axes"], axes)
|
||||
return element
|
||||
|
||||
Reference in New Issue
Block a user