mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-30 20:19:59 +00:00
You can now extend beams to walls.
This commit is contained in:
@@ -622,6 +622,7 @@ class EnableEditingExtrusionProfile(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
|
|
||||||
bpy.ops.object.mode_set(mode="EDIT")
|
bpy.ops.object.mode_set(mode="EDIT")
|
||||||
DecorationsHandler.install(context)
|
DecorationsHandler.install(context)
|
||||||
|
if not bpy.app.background:
|
||||||
bpy.ops.wm.tool_set_by_id(name="bim.cad_tool")
|
bpy.ops.wm.tool_set_by_id(name="bim.cad_tool")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|||||||
@@ -464,14 +464,44 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
def hotkey_S_E(self):
|
def hotkey_S_E(self):
|
||||||
if not bpy.context.selected_objects:
|
if not bpy.context.selected_objects:
|
||||||
return
|
return
|
||||||
elif self.active_material_usage == "LAYER2":
|
|
||||||
bpy.ops.bim.join_wall(join_type="T")
|
selected_usages = {}
|
||||||
elif self.active_material_usage == "LAYER3":
|
for obj in bpy.context.selected_objects:
|
||||||
if not bpy.context.active_object:
|
element = tool.Ifc.get_entity(obj)
|
||||||
pass
|
if not element:
|
||||||
elif bpy.context.active_object.mode == "OBJECT":
|
obj.select_set(False)
|
||||||
|
continue
|
||||||
|
usage = tool.Model.get_usage_type(element)
|
||||||
|
if not usage:
|
||||||
|
obj.select_set(False)
|
||||||
|
continue
|
||||||
|
selected_usages.setdefault(usage, []).append(obj)
|
||||||
|
|
||||||
|
if len(bpy.context.selected_objects) == 1:
|
||||||
|
if self.active_material_usage == "LAYER3":
|
||||||
|
# Edit LAYER2 profile
|
||||||
|
if bpy.context.active_object and bpy.context.active_object.mode == "OBJECT":
|
||||||
bpy.ops.bim.enable_editing_extrusion_profile()
|
bpy.ops.bim.enable_editing_extrusion_profile()
|
||||||
|
elif self.active_material_usage == "LAYER2":
|
||||||
|
# Extend LAYER2 to cursor
|
||||||
|
bpy.ops.bim.join_wall(join_type="T")
|
||||||
elif self.active_material_usage == "PROFILE":
|
elif self.active_material_usage == "PROFILE":
|
||||||
|
# Extend PROFILE to cursor
|
||||||
|
bpy.ops.bim.extend_profile(join_type="T")
|
||||||
|
elif self.active_material_usage == "LAYER2" and selected_usages.get("PROFILE", []):
|
||||||
|
# Extend PROFILEs to LAYER2
|
||||||
|
[o.select_set(False) for o in selected_usages.get("LAYER3", [])]
|
||||||
|
[o.select_set(False) for o in selected_usages.get("LAYER2", []) if o != bpy.context.active_object]
|
||||||
|
bpy.ops.bim.extend_profile(join_type="T")
|
||||||
|
elif self.active_material_usage == "LAYER2":
|
||||||
|
# Extend LAYER2s to LAYER2
|
||||||
|
[o.select_set(False) for o in selected_usages.get("LAYER3", [])]
|
||||||
|
[o.select_set(False) for o in selected_usages.get("PROFILE", [])]
|
||||||
|
bpy.ops.bim.join_wall(join_type="T")
|
||||||
|
elif self.active_material_usage == "PROFILE":
|
||||||
|
# Extend PROFILEs to PROFILE
|
||||||
|
[o.select_set(False) for o in selected_usages.get("LAYER3", [])]
|
||||||
|
[o.select_set(False) for o in selected_usages.get("LAYER2", [])]
|
||||||
bpy.ops.bim.extend_profile(join_type="T")
|
bpy.ops.bim.extend_profile(join_type="T")
|
||||||
|
|
||||||
def hotkey_S_F(self):
|
def hotkey_S_F(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user