SET(TEST_NAMES
TestExportToGEOM
TestExportToGEOMAllGroupsAndFields
+ TestExportToGEOMPartSet.py
Test2882
)
#
from salome.shaper import model
+from ModelAPI import *
model.begin()
partSet = model.moduleDocument()
SketchCircle_1 = Sketch_1.addCircle(0, 0, 2)
model.do()
Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0)
-RemoveResults_1 = model.addRemoveResults(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")])
+removeResults(Extrusion_1.feature().results())
model.end()
# check the number of bodies = 0, number of construction = 1
-from ModelAPI import *
assert(Part_1.document().size(ModelAPI_ResultConstruction.group()) == 1)
assert(Part_1.document().size(ModelAPI_ResultBody.group()) == 0)
void ModelHighAPI_Interface::setName(const std::string& theName)
{
- feature()->data()->setName(theName);
+ if (feature().get())
+ feature()->data()->setName(theName);
}
std::string ModelHighAPI_Interface::name() const
std::list<ModelHighAPI_Selection> aSelectionList;
- std::list<std::shared_ptr<ModelAPI_Result> > aResults = feature()->results();
- for (auto it = aResults.begin(), end = aResults.end(); it != end; ++it) {
- if (!(*it)->isDisabled())
- aSelectionList.push_back(ModelHighAPI_Selection(*it));
+ if (feature().get()) {
+ std::list<std::shared_ptr<ModelAPI_Result> > aResults = feature()->results();
+ for (auto it = aResults.begin(), end = aResults.end(); it != end; ++it) {
+ if (!(*it)->isDisabled())
+ aSelectionList.push_back(ModelHighAPI_Selection(*it));
+ }
}
return aSelectionList;