Fix regression bug where you couldn't add a grid.

This commit is contained in:
Dion Moult
2021-10-23 21:19:10 +11:00
parent 918915aeae
commit 7bccf10fec
8 changed files with 121 additions and 49 deletions
@@ -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)