Repositioning a group of objects using rectangle()


#1

Basically, is there a way to make this work? When I group some objects, say a collection of squares, where the group is named “squares,” and then try to reposition them like so:

object "squares"
changeobjects "rectangle", rectangle(545,770,770,1081)
selectnoobjects

The group does not move, and it becomes unselectable, meaning that in Design View, I can’t click on it and get handles, so I can’t move it or delete it. It shows up in Form Explorer, but changing its coordinates has no effect. I can interact with the grouped object in Data View (when the grouped objects are data cells for example, instead of squares).

The only way I can get out of this seems to be to Select All in the form, which doesn’t appear to select the grouped object (still no handles), and then Arrange > Ungroup, at which point I recover my original squares, but lose grouping on all of the other objects in the form.

Has anyone successfully repositioned a group using a procedure?


#2

I just created a group of 5 rectangles. The group name was “Squares”. The individual rectangles were named Square1, Square2, etc.

The code was

selectobjects objectinfo("name") contains "square"
changeobjects "rectangle", rectangleadjust(objectinfo("rectangle"),50,0,50,0)

All 5 rectangles moved down 50 pixels. The same code works, if they aren’t grouped. It’s the individual objects that were selected and moved by that code.


#3

Even simpler:

moveobjects "square","beginswith",50,50

#4

Okay, thank you! I don’t manipulate graphic objects in code very often, and had somehow overlooked both of those options in my determination to move a group.