mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
See #1676. Tab now toggles space boundary surface profile editing.
This commit is contained in:
@@ -46,7 +46,7 @@ class CadTool(WorkSpaceTool):
|
|||||||
("bim.cad_hotkey", {"type": "X", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_X")]}),
|
("bim.cad_hotkey", {"type": "X", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_X")]}),
|
||||||
)
|
)
|
||||||
|
|
||||||
def draw_settings(context, layout, tool):
|
def draw_settings(context, layout, workspace_tool):
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
if not obj or not obj.data:
|
if not obj or not obj.data:
|
||||||
return
|
return
|
||||||
@@ -54,14 +54,19 @@ class CadTool(WorkSpaceTool):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.label(text="", icon="EVENT_SHIFT")
|
row.label(text="", icon="EVENT_SHIFT")
|
||||||
row.label(text="", icon="EVENT_Q")
|
row.label(text="", icon="EVENT_Q")
|
||||||
if obj.BIMObjectProperties.ifc_definition_id:
|
element = tool.Ifc.get_entity(obj)
|
||||||
row.operator("bim.edit_extrusion_profile", text="Save Profile")
|
if element:
|
||||||
row.operator("bim.align_view_to_profile", text="", icon="AXIS_FRONT")
|
if element.is_a("IfcProfileDef"):
|
||||||
row.operator("bim.disable_editing_extrusion_profile", text="", icon="CANCEL")
|
row.operator("bim.edit_arbitrary_profile", text="Save Profile")
|
||||||
else:
|
row.operator("bim.align_view_to_profile", text="", icon="AXIS_FRONT")
|
||||||
row.operator("bim.edit_arbitrary_profile", text="Save Profile")
|
row.operator("bim.disable_editing_arbitrary_profile", text="", icon="CANCEL")
|
||||||
row.operator("bim.align_view_to_profile", text="", icon="AXIS_FRONT")
|
elif element.is_a("IfcRelSpaceBoundary"):
|
||||||
row.operator("bim.disable_editing_arbitrary_profile", text="", icon="CANCEL")
|
row.operator("bim.edit_boundary_geometry", text="Save Profile")
|
||||||
|
row.operator("bim.disable_editing_boundary_geometry", text="", icon="CANCEL")
|
||||||
|
else:
|
||||||
|
row.operator("bim.edit_extrusion_profile", text="Save Profile")
|
||||||
|
row.operator("bim.align_view_to_profile", text="", icon="AXIS_FRONT")
|
||||||
|
row.operator("bim.disable_editing_extrusion_profile", text="", icon="CANCEL")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.label(text="", icon="EVENT_SHIFT")
|
row.label(text="", icon="EVENT_SHIFT")
|
||||||
@@ -255,28 +260,30 @@ class CadHotkey(bpy.types.Operator):
|
|||||||
bpy.ops.bim.cad_offset(distance=self.props.distance)
|
bpy.ops.bim.cad_offset(distance=self.props.distance)
|
||||||
|
|
||||||
def hotkey_S_Q(self):
|
def hotkey_S_Q(self):
|
||||||
if tool.Ifc.get_entity(bpy.context.active_object):
|
element = tool.Ifc.get_entity(bpy.context.active_object)
|
||||||
if bpy.context.active_object.data.BIMMeshProperties.subshape_type == "PROFILE":
|
if bpy.context.active_object.data.BIMMeshProperties.subshape_type == "PROFILE":
|
||||||
|
if element.is_a("IfcProfileDef"):
|
||||||
|
bpy.ops.bim.edit_arbitrary_profile()
|
||||||
|
elif element.is_a("IfcProfileDef"):
|
||||||
|
bpy.ops.bim.edit_boundary_geometry()
|
||||||
|
else:
|
||||||
bpy.ops.bim.edit_extrusion_profile()
|
bpy.ops.bim.edit_extrusion_profile()
|
||||||
elif bpy.context.active_object.data.BIMMeshProperties.subshape_type == "AXIS":
|
elif bpy.context.active_object.data.BIMMeshProperties.subshape_type == "AXIS":
|
||||||
bpy.ops.bim.edit_extrusion_axis()
|
bpy.ops.bim.edit_extrusion_axis()
|
||||||
|
|
||||||
elif (
|
elif (
|
||||||
(RailingData.is_loaded or not RailingData.load())
|
(RailingData.is_loaded or not RailingData.load())
|
||||||
and RailingData.data["parameters"]
|
and RailingData.data["parameters"]
|
||||||
and bpy.context.active_object.BIMRailingProperties.is_editing_path
|
and bpy.context.active_object.BIMRailingProperties.is_editing_path
|
||||||
):
|
):
|
||||||
bpy.ops.bim.finish_editing_railing_path()
|
bpy.ops.bim.finish_editing_railing_path()
|
||||||
|
|
||||||
elif (
|
elif (
|
||||||
(RoofData.is_loaded or not RoofData.load())
|
(RoofData.is_loaded or not RoofData.load())
|
||||||
and RoofData.data["parameters"]
|
and RoofData.data["parameters"]
|
||||||
and bpy.context.active_object.BIMRoofProperties.is_editing_path
|
and bpy.context.active_object.BIMRoofProperties.is_editing_path
|
||||||
):
|
):
|
||||||
bpy.ops.bim.finish_editing_roof_path()
|
bpy.ops.bim.finish_editing_roof_path()
|
||||||
|
|
||||||
else:
|
|
||||||
bpy.ops.bim.edit_arbitrary_profile()
|
|
||||||
|
|
||||||
def hotkey_S_R(self):
|
def hotkey_S_R(self):
|
||||||
if self.is_profile():
|
if self.is_profile():
|
||||||
|
|||||||
@@ -720,6 +720,11 @@ class OverrideModeSetEdit(bpy.types.Operator):
|
|||||||
|
|
||||||
if context.active_object:
|
if context.active_object:
|
||||||
context.active_object.select_set(True)
|
context.active_object.select_set(True)
|
||||||
|
|
||||||
|
element = tool.Ifc.get_entity(context.active_object)
|
||||||
|
if element.is_a("IfcRelSpaceBoundary"):
|
||||||
|
return bpy.ops.bim.enable_editing_boundary_geometry()
|
||||||
|
|
||||||
for obj in objs:
|
for obj in objs:
|
||||||
if not obj:
|
if not obj:
|
||||||
continue
|
continue
|
||||||
@@ -834,6 +839,11 @@ class OverrideModeSetObject(bpy.types.Operator):
|
|||||||
if not tool.Ifc.get():
|
if not tool.Ifc.get():
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
if context.active_object:
|
||||||
|
element = tool.Ifc.get_entity(context.active_object)
|
||||||
|
if element.is_a("IfcRelSpaceBoundary"):
|
||||||
|
return bpy.ops.bim.edit_boundary_geometry()
|
||||||
|
|
||||||
objs = context.selected_objects or [context.active_object]
|
objs = context.selected_objects or [context.active_object]
|
||||||
|
|
||||||
self.edited_objs = []
|
self.edited_objs = []
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ class EnableEditingArbitraryProfile(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
props = context.scene.BIMProfileProperties
|
props = context.scene.BIMProfileProperties
|
||||||
profile = tool.Ifc.get().by_id(props.active_profile_id)
|
profile = tool.Ifc.get().by_id(props.active_profile_id)
|
||||||
obj = tool.Model.import_profile(profile)
|
obj = tool.Model.import_profile(profile)
|
||||||
|
tool.Ifc.link(profile, obj)
|
||||||
bpy.context.scene.collection.objects.link(obj)
|
bpy.context.scene.collection.objects.link(obj)
|
||||||
bpy.context.view_layer.objects.active = obj
|
bpy.context.view_layer.objects.active = obj
|
||||||
bpy.ops.object.mode_set(mode="EDIT")
|
bpy.ops.object.mode_set(mode="EDIT")
|
||||||
|
|||||||
Reference in New Issue
Block a user