PartDesign: add 'VisibleFeature' attribute to BodyPy
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "Mod/Part/App/Part2DObject.h"
|
||||
#include "Mod/PartDesign/App/Body.h"
|
||||
#include "Mod/PartDesign/App/Feature.h"
|
||||
|
||||
// inclusion of the generated files (generated out of ItemPy.xml)
|
||||
#include "BodyPy.h"
|
||||
@@ -89,3 +90,12 @@ PyObject* BodyPy::insertObject(PyObject *args)
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
Py::Object BodyPy::getVisibleFeature() const {
|
||||
for(auto obj : getBodyPtr()->Group.getValues()) {
|
||||
if(obj->Visibility.getValue() && obj->isDerivedFrom(PartDesign::Feature::getClassTypeId()))
|
||||
return Py::Object(obj->getPyObject(),true);
|
||||
}
|
||||
return Py::Object();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user