diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 8391f5def5..9726e2e6b2 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -3980,12 +3980,11 @@ void StdCmdClarifySelection::activated(int iMsg) Q_UNUSED(iMsg); // Get the active view - auto view = Application::Instance->activeView(); - if (!view || !view->isDerivedFrom(View3DInventor::getClassTypeId())) { + auto view3d = freecad_cast(Application::Instance->activeView()); + if (!view3d) { return; } - auto view3d = static_cast(view); auto viewer = view3d->getViewer(); if (!viewer) { return; @@ -4027,7 +4026,7 @@ void StdCmdClarifySelection::activated(int iMsg) continue; // Cast to ViewProviderDocumentObject to get the object - auto vpDoc = dynamic_cast(vp); + auto vpDoc = freecad_cast(vp); if (!vpDoc) continue;