From 4bb372ef87f86de0b4f825e3fb80921fd7af9895 Mon Sep 17 00:00:00 2001 From: Furgo <148809153+furgo16@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:36:43 +0100 Subject: [PATCH] Start: set specific zoom level for new BIM projects (#20271) * Gui: allow viewDefaultOrientation function to accept the None value, as per the docstring * Start, BIM: set specific zoom level for new BIM projects --- src/Gui/View3DPy.cpp | 2 +- src/Mod/Start/Gui/StartView.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index eb8b946289..b99918ddba 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -553,7 +553,7 @@ Py::Object View3DInventorPy::viewDefaultOrientation(const Py::Tuple& args) { char* view = nullptr; double scale = -1.0; - if (!PyArg_ParseTuple(args.ptr(), "|sd", &view, &scale)) + if (!PyArg_ParseTuple(args.ptr(), "|zd", &view, &scale)) throw Py::Exception(); try { diff --git a/src/Mod/Start/Gui/StartView.cpp b/src/Mod/Start/Gui/StartView.cpp index dc45b87849..a8b45b89f0 100644 --- a/src/Mod/Start/Gui/StartView.cpp +++ b/src/Mod/Start/Gui/StartView.cpp @@ -330,6 +330,11 @@ void StartView::newArchFile() const catch (...) { Gui::Application::Instance->activateWorkbench("ArchWorkbench"); } + + // Set the camera zoom level to 10 m, which is more appropriate for architectural projects + Gui::Command::doCommand( + Gui::Command::Gui, + "Gui.activeDocument().activeView().viewDefaultOrientation(None, 10000.0)"); postStart(PostStartBehavior::doNotSwitchWorkbench); }