diff --git a/src/blenderbim/blenderbim/bim/module/model/profile.py b/src/blenderbim/blenderbim/bim/module/model/profile.py index 9603f30177..818dbcf567 100644 --- a/src/blenderbim/blenderbim/bim/module/model/profile.py +++ b/src/blenderbim/blenderbim/bim/module/model/profile.py @@ -96,6 +96,7 @@ def mode_callback(obj, data): class DumbProfileGenerator: def __init__(self, relating_type): self.relating_type = relating_type + self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) def generate(self, link_to_scene=True): self.file = IfcStore.get_file() @@ -108,9 +109,10 @@ class DumbProfileGenerator: self.body_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body", "MODEL_VIEW") self.axis_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Axis", "GRAPH_VIEW") + props = bpy.context.scene.BIMModelProperties self.collection = bpy.context.view_layer.active_layer_collection.collection self.collection_obj = bpy.data.objects.get(self.collection.name) - self.depth = 3 + self.depth = props.extrusion_depth * self.unit_scale self.rotation = 0 self.location = Vector((0, 0, 0)) self.cardinal_point = int(bpy.context.scene.BIMModelProperties.cardinal_point) diff --git a/src/blenderbim/blenderbim/bim/module/model/wall.py b/src/blenderbim/blenderbim/bim/module/model/wall.py index 4913ed2768..bbcaff1736 100644 --- a/src/blenderbim/blenderbim/bim/module/model/wall.py +++ b/src/blenderbim/blenderbim/bim/module/model/wall.py @@ -400,6 +400,7 @@ class DumbWallRecalculator: class DumbWallGenerator: def __init__(self, relating_type): self.relating_type = relating_type + self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) def generate(self, link_to_scene=True): self.file = IfcStore.get_file() @@ -410,11 +411,12 @@ class DumbWallGenerator: self.body_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body", "MODEL_VIEW") self.axis_context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Plan", "Axis", "GRAPH_VIEW") + props = bpy.context.scene.BIMModelProperties self.collection = bpy.context.view_layer.active_layer_collection.collection self.collection_obj = bpy.data.objects.get(self.collection.name) self.width = self.layers["thickness"] - self.height = 3.0 - self.length = 1.0 + self.height = props.extrusion_depth * self.unit_scale + self.length = props.length * self.unit_scale self.rotation = 0.0 self.location = Vector((0, 0, 0)) diff --git a/src/blenderbim/blenderbim/bim/module/model/workspace.py b/src/blenderbim/blenderbim/bim/module/model/workspace.py index 624614848f..288b51c3d6 100644 --- a/src/blenderbim/blenderbim/bim/module/model/workspace.py +++ b/src/blenderbim/blenderbim/bim/module/model/workspace.py @@ -86,7 +86,7 @@ class BimToolUI: elif context.region.type == "UI": cls.draw_sidebar_interface() - if context.active_object: + if context.active_object and context.selected_objects: cls.draw_edit_object_interface(context) elif not context.selected_objects: cls.draw_create_object_interface()