From a1b8a2ec7034ba69aaa1578e9bb81ba0b79dd006 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Sun, 15 Oct 2023 14:28:32 +0200 Subject: [PATCH] Draft: Change get_3d_view to only return the active 3D view (#11050) Related issue: #10634 Also needed to avoid warnings from the PlaneGui class. --- src/Mod/Draft/draftutils/gui_utils.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Mod/Draft/draftutils/gui_utils.py b/src/Mod/Draft/draftutils/gui_utils.py index 63359b8e15..f7e843b13d 100644 --- a/src/Mod/Draft/draftutils/gui_utils.py +++ b/src/Mod/Draft/draftutils/gui_utils.py @@ -58,10 +58,7 @@ def get_3d_view(): Returns ------- Gui::View3DInventor - Return the current `ActiveView` in the active document, - or the first `Gui::View3DInventor` view found. - - Return `None` if the graphical interface is not available. + Return the current `ActiveView` in the active document or `None`. """ if App.GuiUp: # FIXME The following two imports were added as part of PR4926 @@ -73,12 +70,6 @@ def get_3d_view(): if "View3DInventor" in str(type(v)): return v - # print("Debug: Draft: Warning, not working in active view") - v = Gui.ActiveDocument.mdiViewsOfType("Gui::View3DInventor") - if v: - return v[0] - - _wrn(translate("draft", "No graphical interface")) return None