From 4d48c0de5513595efe146d564fcfbb308534610d Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Sun, 2 Mar 2025 18:56:46 +0100 Subject: [PATCH] Draft: fix Draft_Trimex boundary subelement selection Fixes #19614 Instead of using the whole object, the hovered subelement should be used for the boundary. With this PR the handling of the boundary is also 'nesting-aware'. This is however still not the case for the object being extended/trimmed. That object has to be in the global space. --- src/Mod/Draft/draftguitools/gui_trimex.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_trimex.py b/src/Mod/Draft/draftguitools/gui_trimex.py index 27294ee696..f6a98143d4 100644 --- a/src/Mod/Draft/draftguitools/gui_trimex.py +++ b/src/Mod/Draft/draftguitools/gui_trimex.py @@ -323,10 +323,16 @@ class Trimex(gui_base_original.Modifier): # snapping if snapped: - snapped = self.doc.getObject(snapped['Object']) - if hasattr(snapped, "Shape"): + parent = snapped.get("ParentObject", None) + if parent: + subname = snapped["SubName"] + else: + parent = self.doc.getObject(snapped["Object"]) + subname = snapped["Component"] + shape = Part.getShape(parent, subname, needSubElement=True, noElementMap=True) + if shape.Edges: pts = [] - for e in snapped.Shape.Edges: + for e in shape.Edges: int = DraftGeomUtils.findIntersection(edge, e, True, True) if int: pts.extend(int)