2 Author: Sergey Pokhodenko
3 Copyright (C) 2014-20xx CEA/DEN, EDF R&D
6 from model.roots import Interface
9 def addGroup(part, *args):
10 """Add an Group feature to the Part and return Group.
12 Pass all args to Group __init__ function.
15 feature = part.addFeature("Group")
16 return Group(feature, *args)
19 class Group(Interface):
21 def __init__(self, feature, *args):
22 Interface.__init__(self, feature)
23 assert(self._feature.getKind() == "Group")
25 self._group_list = self._feature.data().selectionList("group_list")
27 assert(self._group_list)
29 assert(len(args) == 1)
30 self.setGroupList(args[0])
33 def setGroupList(self, main_objects):
34 """Modify group_list attribute of the feature.
38 self._fill_attribute(self._group_list, group_list)