This commit is contained in:
Andrej730
2025-01-27 16:07:19 +05:00
parent 378086ac7b
commit 7b4fa6b5c0
3 changed files with 17 additions and 7 deletions
@@ -149,7 +149,7 @@ class AssignPresentationLayer(bpy.types.Operator, tool.Ifc.Operator):
**{ **{
"items": [self.file.by_id(item.BIMMeshProperties.ifc_definition_id)], "items": [self.file.by_id(item.BIMMeshProperties.ifc_definition_id)],
"layer": self.file.by_id(self.layer), "layer": self.file.by_id(self.layer),
} },
) )
return {"FINISHED"} return {"FINISHED"}
@@ -171,7 +171,7 @@ class UnassignPresentationLayer(bpy.types.Operator, tool.Ifc.Operator):
**{ **{
"items": [self.file.by_id(item.BIMMeshProperties.ifc_definition_id)], "items": [self.file.by_id(item.BIMMeshProperties.ifc_definition_id)],
"layer": self.file.by_id(self.layer), "layer": self.file.by_id(self.layer),
} },
) )
return {"FINISHED"} return {"FINISHED"}
+6 -2
View File
@@ -676,8 +676,12 @@ class Model(bonsai.core.tool.Model):
(obj.matrix_world @ Vector((max_x, layers["offset"], 0.0))).to_2d(), (obj.matrix_world @ Vector((max_x, layers["offset"], 0.0))).to_2d(),
], ],
"side": [ "side": [
(obj.matrix_world @ Vector((min_x, layers["offset"] + (layers["thickness"] * direction), 0.0))).to_2d(), (
(obj.matrix_world @ Vector((max_x, layers["offset"] + (layers["thickness"] * direction), 0.0))).to_2d(), obj.matrix_world @ Vector((min_x, layers["offset"] + (layers["thickness"] * direction), 0.0))
).to_2d(),
(
obj.matrix_world @ Vector((max_x, layers["offset"] + (layers["thickness"] * direction), 0.0))
).to_2d(),
], ],
} }
axes["reference"] = [ axes["reference"] = [
@@ -106,12 +106,18 @@ class TestGetPropertyUnit(test.bootstrap.IFC4):
length2 = ifcopenshell.api.unit.add_si_unit(self.file, unit_type="LENGTHUNIT", prefix="CENTI") length2 = ifcopenshell.api.unit.add_si_unit(self.file, unit_type="LENGTHUNIT", prefix="CENTI")
area = ifcopenshell.api.unit.add_si_unit(self.file, unit_type="AREAUNIT") area = ifcopenshell.api.unit.add_si_unit(self.file, unit_type="AREAUNIT")
ifcopenshell.api.unit.assign_unit(self.file, units=[length, area]) ifcopenshell.api.unit.assign_unit(self.file, units=[length, area])
prop = self.file.createIfcPropertyEnumeratedValue(Name="Foo", EnumerationValues=[self.file.createIfcLengthMeasure(42.0)]) prop = self.file.createIfcPropertyEnumeratedValue(
Name="Foo", EnumerationValues=[self.file.createIfcLengthMeasure(42.0)]
)
assert subject.get_property_unit(prop, self.file) == length assert subject.get_property_unit(prop, self.file) == length
prop.EnumerationValues = [] prop.EnumerationValues = []
prop.EnumerationReference = self.file.createIfcPropertyEnumeration("Foo", [self.file.createIfcAreaMeasure(42.0)]) prop.EnumerationReference = self.file.createIfcPropertyEnumeration(
"Foo", [self.file.createIfcAreaMeasure(42.0)]
)
assert subject.get_property_unit(prop, self.file) == area assert subject.get_property_unit(prop, self.file) == area
prop.EnumerationReference = self.file.createIfcPropertyEnumeration("Foo", [self.file.createIfcAreaMeasure(42.0)], Unit=length2) prop.EnumerationReference = self.file.createIfcPropertyEnumeration(
"Foo", [self.file.createIfcAreaMeasure(42.0)], Unit=length2
)
assert subject.get_property_unit(prop, self.file) == length2 assert subject.get_property_unit(prop, self.file) == length2
prop.EnumerationValues = [self.file.createIfcAreaMeasure(42.0)] prop.EnumerationValues = [self.file.createIfcAreaMeasure(42.0)]
assert subject.get_property_unit(prop, self.file) == length2 assert subject.get_property_unit(prop, self.file) == length2