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:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user