I have found it. The GetLengthOrientation method gives me the angle in radians, if I transform it to degrees I can store it in a database. Now, when I create the shape from database, the width is not working ok. I give the location, height and width and then rotate the shape, and it does not work ok. My code:
Dim
rect As NShape = factory.CreateShape(BasicShapes.Rectangle)Dim x As Single = CSng(fila.Item(tbplazas.XColumn.Caption).ToString)Dim y As Single = CSng(fila.Item(tbplazas.YColumn.Caption).ToString)Dim ancho As Single = CSng(fila.Item(tbplazas.AnchoColumn.Caption).ToString)Dim alto As Single = CSng(fila.Item(tbplazas.AltoColumn.Caption).ToString)Dim angulo As Single = CSng(fila.Item(tbplazas.AnguloColumn.Caption).ToString)NDrawingDocument1.ActiveLayer.AddChild(rect)
rect.Height = alto
rect.Width = ancho
rect.Location =
New NPointF(x, y)rect.Name = fila.Item(tbplazas.IdColumn.Caption).ToString
rect.Rotate(
CoordinateSystem.Scene, angulo, rect.Center)Why the width is changed after the rotation?