0000672: Loading Example Drawing extraction crashes at Baseclass.cpp line 115

This commit is contained in:
wmayer
2012-04-16 15:57:10 +02:00
parent ab48b280ec
commit e558efac9d
8 changed files with 70 additions and 2 deletions

View File

@@ -57,6 +57,7 @@
#include "DrawingView.h"
#include <Base/Stream.h>
#include <Base/gzstream.h>
#include <Base/PyObjectBase.h>
#include <Gui/FileDialog.h>
#include <Gui/WaitCursor.h>
@@ -434,4 +435,9 @@ void DrawingView::viewAll()
m_view->fitInView(m_view->scene()->sceneRect(), Qt::KeepAspectRatio);
}
PyObject* DrawingView::getPyObject()
{
Py_Return;
}
#include "moc_DrawingView.cpp"

View File

@@ -93,6 +93,7 @@ public:
void printPdf();
void printPreview();
void print(QPrinter* printer);
PyObject* getPyObject();
protected:
void contextMenuEvent(QContextMenuEvent *event);

View File

@@ -100,6 +100,9 @@ int TopoShapeShellPy::PyInit(PyObject* args, PyObject* /*kwd*/)
shape = sewShell.ApplySewing(shell);
}
if (shape.IsNull())
Standard_Failure::Raise("Shape is null");
if (shape.ShapeType() != TopAbs_SHELL)
Standard_Failure::Raise("Shape is not a shell");
}

View File

@@ -1,5 +1,5 @@
import FreeCAD,FreeCADGui
FreeCADGui.activateWorkbench("DrawingWorkbench")
FreeCAD.open(FreeCAD.getResourceDir()+"examples/DrawingExample.FCStd")
FreeCADGui.SendMsgToActiveView("ViewFit")
FreeCADGui.activeDocument().activeView().viewAxometric()
FreeCADGui.activeDocument().sendMsgToViews("ViewFit")
FreeCADGui.activeDocument().sendMsgToViews("ViewAxo")