diff --git a/pcbnew/python/swig/pcb_group.i b/pcbnew/python/swig/pcb_group.i index 3067a62045..66e62a633d 100644 --- a/pcbnew/python/swig/pcb_group.i +++ b/pcbnew/python/swig/pcb_group.i @@ -1,6 +1,27 @@ -%include pcb_group.h %{ #include %} +%include pcb_group.h + +%extend PCB_GROUP +{ + std::deque GetItemsDeque() + { + std::deque result; + + const std::unordered_set items = $self->GetItems(); + + for(BOARD_ITEM* item: items) + result.push_back(item); + + return result; + } + + %pythoncode + %{ + def GetItems(self): + return [item.Cast() for item in self.GetItemsDeque()] + %} +}