PyObject* DrawPagePy::addView(PyObject* args) { //this implements iRC = pyPage.addView(pyView) -or- //doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str()); PyObject *pcDocObj; if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &pcDocObj)) { PyErr_SetString(PyExc_TypeError, "DrawPagePy::AddView - Bad Arg - not DocumentObject"); return nullptr; } DrawPage* page = getDrawPagePtr(); //get DrawPage for pyPage //TODO: argument 1 arrives as "DocumentObjectPy", not "DrawViewPy" //how to validate that obj is DrawView before use?? DrawViewPy* pyView = static_cast<TechDraw::DrawViewPy*>(pcDocObj); DrawView* view = pyView->getDrawViewPtr(); //get DrawView for pyView int rc = page->addView(view); return PyInt_FromLong((long) rc); }