Path.Area: Changed FeatureArea WorkPlane behavior
FeatureArea will return the user defined workplane if there is one, or else it returns auto selected plane by its internal Area object
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include <CXX/Objects.hxx>
|
||||
#include <Mod/Part/App/TopoShapePy.h>
|
||||
#include "FeatureArea.h"
|
||||
|
||||
// inclusion of the generated files (generated out of FeatureAreaPy.xml)
|
||||
@@ -80,6 +81,21 @@ PyObject* FeatureAreaPy::setParams(PyObject *args, PyObject *keywds)
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
Py::Object FeatureAreaPy::getWorkPlane(void) const {
|
||||
return Part::shape2pyshape(getFeatureAreaPtr()->getArea().getPlane());
|
||||
}
|
||||
|
||||
void FeatureAreaPy::setWorkPlane(Py::Object obj) {
|
||||
PyObject* p = obj.ptr();
|
||||
if (!PyObject_TypeCheck(p, &(Part::TopoShapePy::Type))) {
|
||||
std::string error = std::string("type must be 'TopoShape', not ");
|
||||
error += p->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
}
|
||||
getFeatureAreaPtr()->setWorkPlane(
|
||||
static_cast<Part::TopoShapePy*>(p)->getTopoShapePtr()->getShape());
|
||||
}
|
||||
|
||||
PyObject *FeatureAreaPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user