You can now draw walls at a set RL

This commit is contained in:
Dion Moult
2022-10-19 17:54:25 +11:00
parent 9c28a95f41
commit ec955ca717
6 changed files with 16 additions and 6 deletions
@@ -75,7 +75,7 @@ class AddFilledOpening(bpy.types.Operator, tool.Ifc.Operator):
if container:
container_obj = tool.Ifc.get_object(container)
if container_obj:
new_matrix[2][3] = container_obj.matrix_world[2][3] + props.rl
new_matrix[2][3] = container_obj.matrix_world[2][3] + props.rl2
filling_obj.matrix_world = new_matrix
bpy.context.view_layer.update()
@@ -228,7 +228,8 @@ class BIMModelProperties(PropertyGroup):
x: bpy.props.FloatProperty(name="X", default=0.5)
y: bpy.props.FloatProperty(name="Y", default=0.5)
z: bpy.props.FloatProperty(name="Z", default=0.5)
rl: bpy.props.FloatProperty(name="RL", default=1)
rl1: bpy.props.FloatProperty(name="RL", default=1) # Used for things like walls, doors, flooring, skirting, etc
rl2: bpy.props.FloatProperty(name="RL", default=1) # Used for things like windows, other hosted furniture
x_angle: bpy.props.FloatProperty(name="X Angle", default=0)
type_page: bpy.props.IntProperty(name="Type Page", default=1, update=update_type_page)
type_template: bpy.props.EnumProperty(
@@ -561,6 +561,7 @@ class DumbWallGenerator:
return self.create_wall(link_to_scene)
def create_wall(self, link_to_scene):
props = bpy.context.scene.BIMModelProperties
ifc_class = self.get_relating_type_class(self.relating_type)
mesh = bpy.data.meshes.new("Dummy")
obj = bpy.data.objects.new(tool.Model.generate_occurrence_name(self.relating_type, ifc_class), mesh)
@@ -568,7 +569,7 @@ class DumbWallGenerator:
matrix_world = Matrix.Rotation(self.rotation, 4, "Z")
matrix_world.col[3] = self.location.to_4d()
if self.collection_obj and self.collection_obj.BIMObjectProperties.ifc_definition_id:
matrix_world[2][3] = self.collection_obj.location[2]
matrix_world[2][3] = self.collection_obj.location[2] + props.rl1
obj.matrix_world = matrix_world
bpy.context.view_layer.update()
self.collection.objects.link(obj)
@@ -98,6 +98,9 @@ class BimToolUI:
if not AuthoringData.data["relating_types_ids"]:
return
if cls.props.ifc_class == "IfcWallType":
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl1", text="RL")
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="extrusion_depth", text="Height")
@@ -113,9 +116,12 @@ class BimToolUI:
row = cls.layout.row(align=True)
label = "Height" if cls.props.ifc_class == "IfcColumn" else "Length"
row.prop(data=cls.props, property="extrusion_depth", text=label)
elif cls.props.ifc_class in ("IfcDoorType", "IfcDoorStyle"):
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl1", text="RL")
elif cls.props.ifc_class in ("IfcWindowType", "IfcWindowStyle", "IfcDoorType", "IfcDoorStyle"):
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl", text="RL")
row.prop(data=cls.props, property="rl2", text="RL")
@classmethod
def draw_edit_object_interface(cls, context):
+2 -1
View File
@@ -135,7 +135,8 @@ class Project(blenderbim.core.tool.Project):
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
props.extrusion_depth = 3 / unit_scale
props.length = 1 / unit_scale
props.rl = 1 / unit_scale
props.rl1 = 0
props.rl2 = 1 / unit_scale
props.x = 0.5 / unit_scale
props.y = 0.5 / unit_scale
props.z = 0.5 / unit_scale
+2 -1
View File
@@ -129,7 +129,8 @@ class TestSetDefaultModelingDimensions(NewFile):
props = bpy.context.scene.BIMModelProperties
assert props.extrusion_depth == 3000
assert props.length == 1000
assert props.rl == 1000
assert props.rl1 == 0
assert props.rl2 == 1000
assert props.x == 500
assert props.y == 500
assert props.z == 500