mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix regression bug where you couldn't add a grid.
This commit is contained in:
@@ -12,7 +12,7 @@ class Usecase:
|
||||
|
||||
def execute(self):
|
||||
element = self.file.create_entity(
|
||||
"IfcGridAxis", **{"axis_tag": self.settings["axis_tag"], "SameSense": self.settings["same_sense"]}
|
||||
"IfcGridAxis", **{"AxisTag": self.settings["axis_tag"], "SameSense": self.settings["same_sense"]}
|
||||
)
|
||||
axes = list(getattr(self.settings["grid"], self.settings["uvw_axes"]) or [])
|
||||
axes.append(element)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
|
||||
|
||||
class TestCreateGridAxis(test.bootstrap.IFC4):
|
||||
def test_run(self):
|
||||
grid = self.file.createIfcGrid()
|
||||
axis = ifcopenshell.api.run(
|
||||
"grid.create_grid_axis", self.file, axis_tag="axis_tag", same_sense=True, uvw_axes="UAxes", grid=grid
|
||||
)
|
||||
assert axis.AxisTag == "axis_tag"
|
||||
assert axis.SameSense is True
|
||||
assert grid.UAxes == (axis,)
|
||||
axis2 = ifcopenshell.api.run(
|
||||
"grid.create_grid_axis", self.file, axis_tag="axis_tag", same_sense=True, uvw_axes="UAxes", grid=grid
|
||||
)
|
||||
assert grid.UAxes == (axis,axis2)
|
||||
Reference in New Issue
Block a user