avoid raising an exception when getting subobjects of the selection and just filter out unsupported types

This commit is contained in:
wmayer
2017-10-12 10:15:28 +02:00
parent 8468a4cb35
commit ee30dfe054

View File

@@ -109,16 +109,16 @@ std::vector<PyObject *> Feature::getPySubObjects(const std::vector<std::string>&
{
try {
std::vector<PyObject *> temp;
for(std::vector<std::string>::const_iterator it=NameVec.begin();it!=NameVec.end();++it){
for (std::vector<std::string>::const_iterator it=NameVec.begin();it!=NameVec.end();++it) {
PyObject *obj = Shape.getShape().getPySubShape((*it).c_str());
if(obj)
if (obj)
temp.push_back(obj);
}
return temp;
}
catch (Standard_Failure& e) {
throw Py::ValueError(e.GetMessageString());
catch (Standard_Failure&) {
//throw Py::ValueError(e.GetMessageString());
return std::vector<PyObject *>();
}
}