Using the "3D Transform" command with C# API

Using the "3D Transform" command with C# API

mucahid_tadik
Explorer Explorer
336 Views
1 Reply
Message 1 of 2

Using the "3D Transform" command with C# API

mucahid_tadik
Explorer
Explorer

I am trying to rotate the drawing drawn in "3D Sketch" with C# API.
Can I use the "3D Transform" command in the "3D Sketch" tab with the C# API?

 

Ekran Alıntısı.PNG

0 Likes
Accepted solutions (1)
337 Views
1 Reply
Reply (1)
Message 2 of 2

mucahid_tadik
Explorer
Explorer
Accepted solution

I did the necessary operation manually in 3D Transform. For those who need:

 

 

 

// Başlangıç noktası
Vector3 startPoint = new Vector3(Points.Vpoint1.X, Points.Vpoint1.Y, 0);

// Çizginin son noktası
Vector3 endPoint = Points.Vpoint1;

double angle = (Math.Atan2(endPoint.Z - startPoint.Z, endPoint.X - startPoint.X));

// Dönme matrisini oluştur
Matrix4x4 rotationMatrix = Matrix4x4.CreateRotationY((float)angle);


// Son noktayı döndür
Vector3 rotatedVector = Vector3.Transform(endPoint - startPoint, rotationMatrix) + startPoint;

 

 

 

0 Likes