Page 1 of 1

vDrawing.rotate

Posted: 25 Nov 2020, 19:31
by ditel
Hi

We have a question How to rotate a vDrawing space.

We use that code to rotate a cad design the code work fine and the cad design image in our app screen rotate well

but when we read the point values of the different entities that make up the design they are with the pre-rotation values. Is there any way that after rotation these changes apply to the points that make up the design entities?
Thanks






rotate code
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dim vDrawing As CADImage = CADImage.CreateImageByExtension("..\..\..\..\..\Files\Entities.dxf")
vDrawing.LoadFromFile("..\..\..\..\..\Files\Entities.dxf")
'visualization must be completed before rotation
vDrawing.Draw(Image1.CreateGraphics(), New RectangleF())
vDrawing.Rotate(CADImport.FaceModule.Axes.Z, 90) 'rotate by 90 degrees
vDrawing.GetExtents()
' adjusting visualization sizes to the control area:
Dim vRect As RectangleF
Dim vRatio As Double = vDrawing.AbsHeight * Image1.ClientSize.Width / (vDrawing.AbsWidth * Image1.ClientSize.Height)
If vRatio > 1 Then
vRect = New RectangleF(0, 0, (Image1.ClientSize.Width / vRatio), Image1.ClientSize.Height)
Else
vRect = New RectangleF(0, 0, Image1.ClientSize.Width, (Image1.ClientSize.Height * vRatio))
End If
'---------------------------------------------------
vDrawing.Draw(Image1.CreateGraphics(), vRect)

Re: vDrawing.rotate

Posted: 26 Nov 2020, 11:36
by support
Hello,

You should rotate points of the entities that make up the design in your code, as shown here: viewtopic.php?f=15&t=4666#p13053

Mikhail

Re: vDrawing.rotate

Posted: 07 Jan 2021, 14:03
by DitelSL
Good morning Mikhail

We have several problems to log in with facebook acount we use a new google acount

When we do the example in the previous post the vertex values of the polyline change but not the Polypoints value there is some way to activate the changes at once? . What de diference off two parameters (polypoints or Vertex)

Thanks Mikhail

Re: vDrawing.rotate

Posted: 07 Jan 2021, 15:24
by DitelSL
Hi again

Other question how can rotate arc entitie ?

Thanks

Re: vDrawing.rotate

Posted: 11 Jan 2021, 18:20
by support
DitelSL wrote:
07 Jan 2021, 14:03
We have several problems to log in with facebook acount we use a new google acount
Please try to log in with Facebook now.

Mikhail

Re: vDrawing.rotate

Posted: 11 Jan 2021, 19:00
by ditel
Ok Mikail now log work with facebook acount
Thanks

Re: vDrawing.rotate

Posted: 13 Jan 2021, 23:55
by support
DitelSL wrote:
07 Jan 2021, 14:03
When we do the example in the previous post the vertex values of the polyline change but not the Polypoints value there is some way to activate the changes at once? . What de diference off two parameters (polypoints or Vertex)
PolyPoints is a property of a CADPolylineBase class which is a base class for CADCircle, CADArc, CADPolyline and CADSpline. If a polyline includes arc segments, each arc is splitted up to a certain number of polypoins determined by a CADImage.Converter.NumberOfPartsInCircle property, so the number of polypoints is greater than the number of vertices. When you change coordinates of vertices and call a CADConverter.Loads method for the polyline, PolyPoints coordinates are changed accordingly, you shouldn't change them by code.

Mikhail