From b7f954c1e5b9da1fc425908ac4edfebb513ebf23 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 16 Sep 2019 11:34:31 +0300 Subject: [PATCH] Fix the python dump of whole-results groups for specific test-case. --- src/CollectionAPI/CollectionAPI_Group.cpp | 2 +- src/ModelAPI/Test/TestSelectorShell.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CollectionAPI/CollectionAPI_Group.cpp b/src/CollectionAPI/CollectionAPI_Group.cpp index 98b6409d6..fae2ae36a 100644 --- a/src/CollectionAPI/CollectionAPI_Group.cpp +++ b/src/CollectionAPI/CollectionAPI_Group.cpp @@ -64,7 +64,7 @@ void CollectionAPI_Group::dump(ModelHighAPI_Dumper& theDumper) const AttributeSelectionListPtr anAttrList = aBase->selectionList(CollectionPlugin_Group::LIST_ID()); theDumper << aBase << " = model.addGroup(" << aDocName << ", "; - if (anAttrList->isWholeResultAllowed()) + if (anAttrList->isWholeResultAllowed() && !anAttrList->selectionType().empty()) theDumper<<"\""<selectionType()<<"\", "; theDumper << anAttrList; if (anAttrList->isGeometricalSelection()) diff --git a/src/ModelAPI/Test/TestSelectorShell.py b/src/ModelAPI/Test/TestSelectorShell.py index a699cbdb3..6d8f1c8e2 100644 --- a/src/ModelAPI/Test/TestSelectorShell.py +++ b/src/ModelAPI/Test/TestSelectorShell.py @@ -31,6 +31,7 @@ aBoxResult = Box_1.feature().results()[0] aShell = GeomAPI_ShapeExplorer(aBoxResult.shape(), GeomAPI_Shape.SHELL) aGroup = Part_1_doc.addFeature("Group") aGroup.selectionList("group_list").append(aBoxResult, aShell.current()) +aGroup.selectionList("group_list").setSelectionType("SHELL") # to compute the shape for the whole result selection correctly model.end() # check that the resulting group is correct -- 2.39.2