Rotate 2d desing and uddate X and Y point value
Posted: 16 Apr 2020, 11:29
good morning
We use this routine to rotate the design and display it on the screen
our question if once rotated there is a way to save this data so that the x and y values of the entities are updated with the rotated values. Can be done?
we use this for rotate desing
Dim Grados As Single
Grados = Me.Txt_Rotar.Text
'visualization must be completed before rotation
vDrawing.Draw(Me.Pct_Visor.CreateGraphics(), New RectangleF())
vDrawing.Rotate(CADImport.FaceModule.Axes.Z, Grados) 'rotate by 90 degrees
vDrawing.BackgroundColor = Color.DimGray
vDrawing.DefaultColor = Color.White
vDrawing.GetExtents()
' adjusting visualization sizes to the control area:
Dim vRect As RectangleF
Dim vRatio As Double = vDrawing.AbsHeight * Pct_Visor.ClientSize.Width / (vDrawing.AbsWidth * Pct_Visor.ClientSize.Height)
If vRatio > 1 Then
vRect = New RectangleF(0, 0, (Pct_Visor.ClientSize.Width / vRatio), Pct_Visor.ClientSize.Height)
Else
vRect = New RectangleF(0, 0, Pct_Visor.ClientSize.Width, (Pct_Visor.ClientSize.Height * vRatio))
End If
'---------------------------------------------------
vDrawing.Draw(Pct_Visor.CreateGraphics(), vRect)
after doing this we need to update the x and y values of all the points of the entities
it is posible?
Thanks
We use this routine to rotate the design and display it on the screen
our question if once rotated there is a way to save this data so that the x and y values of the entities are updated with the rotated values. Can be done?
we use this for rotate desing
Dim Grados As Single
Grados = Me.Txt_Rotar.Text
'visualization must be completed before rotation
vDrawing.Draw(Me.Pct_Visor.CreateGraphics(), New RectangleF())
vDrawing.Rotate(CADImport.FaceModule.Axes.Z, Grados) 'rotate by 90 degrees
vDrawing.BackgroundColor = Color.DimGray
vDrawing.DefaultColor = Color.White
vDrawing.GetExtents()
' adjusting visualization sizes to the control area:
Dim vRect As RectangleF
Dim vRatio As Double = vDrawing.AbsHeight * Pct_Visor.ClientSize.Width / (vDrawing.AbsWidth * Pct_Visor.ClientSize.Height)
If vRatio > 1 Then
vRect = New RectangleF(0, 0, (Pct_Visor.ClientSize.Width / vRatio), Pct_Visor.ClientSize.Height)
Else
vRect = New RectangleF(0, 0, Pct_Visor.ClientSize.Width, (Pct_Visor.ClientSize.Height * vRatio))
End If
'---------------------------------------------------
vDrawing.Draw(Pct_Visor.CreateGraphics(), vRect)
after doing this we need to update the x and y values of all the points of the entities
it is posible?
Thanks