Views: IWxViews;
The Views property returns a workspace views collection.
Executing the example requires a form with the Button1 button, the WorkspaceBox component and the UiWorkspace component named UiWorkspace1, which is a data source for WorkspaceBox.
Add links to the Andy, Drawing, Ui system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
wsp: IWxWorkspace;
Arrow: IWxArrow;
view: IWxView;
Shapes: IWxShapes;
SelectS: IWxSelectedShapes;
Rec: IWxRectangle;
Begin
wsp := UiWorkspace1.WxWorkspace;
Arrow := wsp.CreateArrow;
Arrow.FirstPoint := New GxPointF.Create(1, 2);
Arrow.LastPoint := New GxPointF.Create(3, 19);
Arrow.Angle := 10;
Shapes := wsp.Shapes;
Rec := wsp.CreateRectangle;
Rec.Id := "Rectangle1";
Rec.PinPosition := New GxPointF.Create(12.3,-10);
view := wsp.Views.Item(0);
SelectS := view.SelectedShapes;
SelectS.Add(Shapes.Item(0));
SelectS.Add(shapes.Item(1));
SelectS.Align(WxShapesAlignment.VerticalCenter);
End Sub Button1OnClick;
After executing the example the selected shapes are aligned to the vertical center.
See also: