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
This commit is contained in:
Furgo
2025-03-25 09:36:43 +01:00
committed by GitHub
parent ee4c9a6e8b
commit 4bb372ef87
2 changed files with 6 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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);
}