MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / sActiveDocument

Method sActiveDocument

src/Gui/ApplicationPy.cpp:762–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760}
761
762PyObject* Gui::ApplicationPy::sActiveDocument(PyObject* /*self*/, PyObject* args)
763{
764 if (!PyArg_ParseTuple(args, "")) {
765 return nullptr;
766 }
767
768 requirePythonMainThread("FreeCADGui.activeDocument");
769
770 Document* pcDoc = Application::Instance->activeDocument();
771 if (pcDoc) {
772 return pcDoc->getPyObject();
773 }
774
775 Py_Return;
776}
777
778PyObject* Gui::ApplicationPy::sActiveView(PyObject* /*self*/, PyObject* args)
779{

Callers

nothing calls this directly

Calls 3

requirePythonMainThreadFunction · 0.85
activeDocumentMethod · 0.80
getPyObjectMethod · 0.45

Tested by

no test coverage detected