mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
BIM workspace tool is now no longer wall specific, and adapts to different element types
This commit is contained in:
@@ -3,7 +3,7 @@ from . import handler, prop, ui, grid, product, wall, slab, stair, door, window,
|
|||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
product.AddTypeInstance,
|
product.AddTypeInstance,
|
||||||
wall.AddWall,
|
workspace.HotkeyE,
|
||||||
wall.JoinWall,
|
wall.JoinWall,
|
||||||
wall.AlignWall,
|
wall.AlignWall,
|
||||||
wall.FlipWall,
|
wall.FlipWall,
|
||||||
|
|||||||
@@ -36,21 +36,6 @@ def mode_callback(obj, data):
|
|||||||
IfcStore.edited_objs.add(obj)
|
IfcStore.edited_objs.add(obj)
|
||||||
|
|
||||||
|
|
||||||
class AddWall(bpy.types.Operator):
|
|
||||||
bl_idname = "bim.add_wall"
|
|
||||||
bl_label = "Add Wall"
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
join_type: bpy.props.StringProperty()
|
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
return IfcStore.execute_ifc_operator(self, context)
|
|
||||||
|
|
||||||
def _execute(self, context):
|
|
||||||
props = context.scene.BIMModelProperties
|
|
||||||
bpy.ops.bim.add_type_instance(ifc_class="IfcWallType", relating_type=int(props.relating_type))
|
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class JoinWall(bpy.types.Operator):
|
class JoinWall(bpy.types.Operator):
|
||||||
bl_idname = "bim.join_wall"
|
bl_idname = "bim.join_wall"
|
||||||
bl_label = "Join Wall"
|
bl_label = "Join Wall"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import WorkSpaceTool
|
from bpy.types import WorkSpaceTool
|
||||||
|
from blenderbim.bim.ifc import IfcStore
|
||||||
|
|
||||||
|
|
||||||
class BimTool(WorkSpaceTool):
|
class BimTool(WorkSpaceTool):
|
||||||
@@ -16,8 +17,8 @@ class BimTool(WorkSpaceTool):
|
|||||||
bl_keymap = (
|
bl_keymap = (
|
||||||
# ("bim.wall_tool_op", {"type": 'MOUSEMOVE', "value": 'ANY'}, {"properties": []}),
|
# ("bim.wall_tool_op", {"type": 'MOUSEMOVE', "value": 'ANY'}, {"properties": []}),
|
||||||
# ("mesh.add_wall", {"type": 'LEFTMOUSE', "value": 'PRESS'}, {"properties": []}),
|
# ("mesh.add_wall", {"type": 'LEFTMOUSE', "value": 'PRESS'}, {"properties": []}),
|
||||||
("bim.add_wall", {"type": "A", "value": "PRESS", "shift": True}, {"properties": []}),
|
("bim.add_type_instance", {"type": "A", "value": "PRESS", "shift": True}, {"properties": []}),
|
||||||
("bim.join_wall", {"type": "E", "value": "PRESS", "shift": True}, {"properties": [("join_type", "T")]}),
|
("bim.hotkey_e", {"type": "E", "value": "PRESS", "shift": True}, {"properties": []}),
|
||||||
("bim.join_wall", {"type": "T", "value": "PRESS", "shift": True}, {"properties": [("join_type", "L")]}),
|
("bim.join_wall", {"type": "T", "value": "PRESS", "shift": True}, {"properties": [("join_type", "L")]}),
|
||||||
("bim.join_wall", {"type": "Y", "value": "PRESS", "shift": True}, {"properties": [("join_type", "V")]}),
|
("bim.join_wall", {"type": "Y", "value": "PRESS", "shift": True}, {"properties": [("join_type", "V")]}),
|
||||||
("bim.flip_wall", {"type": "F", "value": "PRESS", "shift": True}, {"properties": []}),
|
("bim.flip_wall", {"type": "F", "value": "PRESS", "shift": True}, {"properties": []}),
|
||||||
@@ -40,20 +41,38 @@ class BimTool(WorkSpaceTool):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, tool):
|
||||||
props = context.scene.BIMModelProperties
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
|
props = context.scene.BIMTypeProperties
|
||||||
|
row.prop(props, "ifc_class", text="")
|
||||||
row.prop(props, "relating_type", text="")
|
row.prop(props, "relating_type", text="")
|
||||||
|
|
||||||
row.label(text="", icon="BLANK1")
|
row.label(text="", icon="BLANK1")
|
||||||
|
|
||||||
row.label(text="", icon="EVENT_SHIFT")
|
row.label(text="", icon="EVENT_SHIFT")
|
||||||
row.label(text="Add", icon="EVENT_A")
|
row.label(text="Add", icon="EVENT_A")
|
||||||
row.label(text="Extend", icon="EVENT_E")
|
|
||||||
row.label(text="Butt", icon="EVENT_T")
|
if props.ifc_class == "IfcWallType":
|
||||||
row.label(text="Mitre", icon="EVENT_Y")
|
row.label(text="Extend", icon="EVENT_E")
|
||||||
row.label(text="Flip", icon="EVENT_F")
|
row.label(text="Butt", icon="EVENT_T")
|
||||||
row.label(text="Split", icon="EVENT_S")
|
row.label(text="Mitre", icon="EVENT_Y")
|
||||||
row.label(text="", icon="EVENT_X")
|
row.label(text="Flip", icon="EVENT_F")
|
||||||
row.label(text="", icon="EVENT_C")
|
row.label(text="Split", icon="EVENT_S")
|
||||||
row.label(text="", icon="EVENT_V")
|
row.label(text="", icon="EVENT_X")
|
||||||
row.label(text="Align")
|
row.label(text="", icon="EVENT_C")
|
||||||
|
row.label(text="", icon="EVENT_V")
|
||||||
|
row.label(text="Align")
|
||||||
|
|
||||||
|
|
||||||
|
class HotkeyE(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.hotkey_e"
|
||||||
|
bl_label = "Hotkey E"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
return IfcStore.execute_ifc_operator(self, context)
|
||||||
|
|
||||||
|
def _execute(self, context):
|
||||||
|
props = context.scene.BIMTypeProperties
|
||||||
|
if props.ifc_class == "IfcWallType":
|
||||||
|
bpy.ops.bim.join_wall(join_type="T")
|
||||||
|
return {"FINISHED"}
|
||||||
|
|||||||
Reference in New Issue
Block a user