Group2D should be a dictionary

More than once I have considered using a Group2D to hold a set of drawing elements.
Adding items is easy.
Drawing the group is easy
But removing an item later is difficult since the only method is ordinal.

Imagine a map made of several hundred items.
In the middle of the map is a ‘rock’
It was added at ordinal 300, but the only way to take the group of items and remove it later is to know what that value is.

If the Group2D was a dictionary, you could identify and amend an item based on a hashed key.

MyTank = MyGroup2D.value(“Tank”)
MyTank.x = MyTank.x + 1

Yes, I could store all the Object2D items in a dictionary and get this functionality, but then I would lose the functionality of the Group2D
eg draw all objects with one call,
scale the group
offset the group etc

Hello Jeff,
I use the pixmapshape function to draw on a picture
I introduce this in a table with the possibility of change
in size, angle and more
it is also possible to redraw directly into the graphic …

the Group2D possibilities can also be used here
Textshape, oval shape, retahleshape, lineshape can be mapped

take a look at the appendix

Thanks for the interest Rudolf
Yes,Object2D items are useful.
I use them a lot.

But as the post is trying to say, it would be better if I could access them as part of a Group2D in a random-access fashion, rather than by ‘array index’