How to set the Selection.Primary object

hi all,
there is a way for set programmatically or by mouse(or mouse+keybord) the Selection.Primary object?
i need to select one object in the selection for use it as reference during the alignment.
i've not found much about this topic in the manuals/forum.

GoView.Selection is just a collection of objects.

to select one object, do:


hi Jake,
Selection.Select() replace the current selection with the given object, right, but is different from what i want to do.
what i would like to do is:
1) select N objects with the rubberband.
2) now the Selection.Primary is set to the first selected object.
3) i would like to set Selection.Primary to an arbitrary other object in the Selection collection.

Rubberband selection calls GoView.SelectInRectangle, which creates a collection of all the objects in the selection box, then calls GoSelection.AddRange(collection).

The Primary selection is the first object in that collection. I think your easiest hook here is to create a custom GoSelection class and override AddRange to re-arrange the collection before calling base.AddRange.

Then set the view’s Selection to be your new Selection class.