Page 1 of 1

Rotate Spline Entitie

Posted: 11 Jan 2021, 12:00
by DitelSL
Hello again.
In our development we need to rotate the different entities of the design with your help we can already rotate lines, points, arcs, text but there is one that resists us when we have a spline entity we rotate all the points contained in the polypoints structure belonging to the spline and but we do not get these to be rotated in the design.
Best Regards and thank you in advance.

We attach the code we use



'********************************************************************************************
Dim vSpline As CADSpline
Dim n_puntos As Long

vSpline = CType(CADDiseño.CurrentLayout.Entities(h), CADSpline)
n_puntos = vSpline.PolyPoints.Count

For hh = 0 To n_puntos - 1
vSpline.PolyPoints(hh) = DPoint.Rotate(vSpline.PolyPoints(hh), center, False, Angle)
Next

CADDiseño.Converter.Loads(vSpline)
'*********************************************************************************************
'center and Angle are several parameters that are passed to the function so they do not appear declared in the sample code.

Re: Rotate Spline Entitie

Posted: 12 Jan 2021, 00:15
by support
Hello,

If a CADSpline entity has fit points (CADSpline.FitCount > 0), you should rotate all the points in a CADSpline.Fit collection. Otherwise (if the CADSpline doesn't have fit points), rotate all the points in a CADSpline.Controls collection.

Mikhail

Re: Rotate Spline Entitie

Posted: 12 Jan 2021, 12:50
by ditel
Ok now work fine
Thanks Mikhail

'***********************************************************************************************
Dim vSpline As CADSpline

vSpline = CType(CADDiseño.CurrentLayout.Entities(h), CADSpline)
If vSpline.FitCount > 0 Then
For hh As Integer = 0 To vSpline.FitCount - 1
vSpline.Controls(hh) = DPoint.Rotate(vSpline.Controls(hh), center, Abs, Angle)
Next
Else
For hh As Integer = 0 To vSpline.ControlCount - 1
vSpline.Controls(hh) = DPoint.Rotate(vSpline.Controls(hh), center, Abs, Angle)
Next
End If

CADDiseño.Converter.Loads(vSpline)
'***********************************************************************************************