mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 19:09:58 +00:00
edit axis as well, with spacebar
This commit is contained in:
@@ -2547,7 +2547,7 @@ class OverrideModeSetObject(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator):
|
class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.direct_profile_edit"
|
bl_idname = "bim.direct_profile_edit"
|
||||||
bl_label = "IFC Direct Profile Edit"
|
bl_label = "IFC Direct Profile Edit"
|
||||||
bl_description = "Directly enter profile edit mode for profiles and extrusions, or exit back to object mode"
|
bl_description = "Directly enter profile/axis edit mode, or exit back to object mode"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
@@ -2589,21 +2589,27 @@ class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
else:
|
else:
|
||||||
# We're editing an extrusion profile (element-level)
|
# We're editing either an extrusion profile or axis (element-level)
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if element:
|
if element and tool.Geometry.has_mesh_properties(obj.data):
|
||||||
|
mesh_props = tool.Geometry.get_mesh_props(obj.data)
|
||||||
|
|
||||||
|
# Check if we're editing axis
|
||||||
|
if mesh_props.subshape_type == "AXIS":
|
||||||
|
return bpy.ops.bim.edit_extrusion_axis()
|
||||||
|
|
||||||
|
# Otherwise, we're editing a profile
|
||||||
body = ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW")
|
body = ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW")
|
||||||
if body:
|
if body:
|
||||||
body = ifcopenshell.util.representation.resolve_representation(body)
|
body = ifcopenshell.util.representation.resolve_representation(body)
|
||||||
extrusion = tool.Model.get_extrusion(body)
|
extrusion = tool.Model.get_extrusion(body)
|
||||||
if extrusion:
|
if extrusion:
|
||||||
# Use the edit_extrusion_profile workflow
|
|
||||||
return bpy.ops.bim.edit_extrusion_profile()
|
return bpy.ops.bim.edit_extrusion_profile()
|
||||||
|
|
||||||
# For other edit modes, use standard operator
|
# For other edit modes, use standard operator
|
||||||
return bpy.ops.bim.override_mode_set_object()
|
return bpy.ops.bim.override_mode_set_object()
|
||||||
|
|
||||||
# We're in object mode, try to enter profile edit
|
# We're in object mode, try to enter profile/axis edit
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
if not obj:
|
if not obj:
|
||||||
self.report({"ERROR"}, "No active object")
|
self.report({"ERROR"}, "No active object")
|
||||||
@@ -2625,8 +2631,11 @@ class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
self.report({"ERROR"}, "Object has no active representation")
|
self.report({"ERROR"}, "Object has no active representation")
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
|
# Check for PROFILE usage (beams, columns, members) - should edit axis
|
||||||
|
if material_usage == "PROFILE":
|
||||||
|
return bpy.ops.bim.enable_editing_extrusion_axis()
|
||||||
|
|
||||||
# Check if this is an element with an extrusion profile (LAYER3, etc)
|
# Check if this is an element with an extrusion profile (LAYER3, etc)
|
||||||
# These should use enable_editing_extrusion_profile
|
|
||||||
body = ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW")
|
body = ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW")
|
||||||
if body:
|
if body:
|
||||||
body = ifcopenshell.util.representation.resolve_representation(body)
|
body = ifcopenshell.util.representation.resolve_representation(body)
|
||||||
@@ -2683,6 +2692,8 @@ class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FlipObject(bpy.types.Operator):
|
class FlipObject(bpy.types.Operator):
|
||||||
bl_idname = "bim.flip_object"
|
bl_idname = "bim.flip_object"
|
||||||
bl_label = "Flip Object"
|
bl_label = "Flip Object"
|
||||||
|
|||||||
Reference in New Issue
Block a user