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):
20 """Interface class for Group feature.
22 Group(feature) -> feature interface without initialization
23 Group(feature, group_list) ->
24 feature interface initialized from arguments:
28 def __init__(self, feature, *args):
29 """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
30 Interface.__init__(self, feature)
31 assert(self._feature.getKind() == "Group")
33 self._group_list = self._feature.data().selectionList("group_list")
35 assert(self._group_list)
40 assert(len(args) == 1)
41 self.setGroupList(args[0])
46 def setGroupList(self, main_objects):
47 """Modify group_list attribute of the feature.
51 self._fill_attribute(self._group_list, group_list)