Size: IGxSizeF;
The Size property determines shape size.
To determine rotation angle, use the IWxShape.Angle property.
Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and a data source for the WorkspaceBox1.
Add links to the Andy, Drawing, Workspace system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Ws: IWxWorkspace;
Shape: IWxShape;
Size: IGxSizeF;
Reg: IWxRegulargon;
Begin
Ws := WorkspaceBox1.View.Workspace;
Reg := Ws.CreateRegulargon;
Reg.Id := "Reg1";
Reg.PinPosition := New GxPointF.Create(12, 2);
Reg.NumberOfSides := 5;
Reg.Text := "Trapezoid";
WS.BeginUpdate;
Shape := WS.Shapes.Item(0);
Shape.Angle := 40;
Size := New GxSizeF.Create(43, 78);
Shape.Size := Size;
WS.EndUpdate;
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Workspace;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Ws: IWxWorkspace;
Shape: IWxShape;
Size: IGxSizeF;
Reg: IWxRegulargon;
PinPoint: GxPointF = New GxPointFClass();
SSize: GxSizeF = New GxSizeFClass();
Begin
Ws := workspaceBoxNet1.View.Workspace;
Reg := Ws.CreateRegulargon();
Reg.Id := "Reg1";
PinPoint.Create(12, 2);
Reg.PinPosition := PinPoint;
Reg.NumberOfSides := 5;
Reg.Text := "Trapezoid";
WS.BeginUpdate();
Shape := WS.Shapes.Item[0];
Shape.Angle := 40;
SSize.Create(43, 78);
Shape.Size := SSize;
WS.EndUpdate();
End Sub;
After executing the example shape size and rotation angle are changed.
See also: