Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1 REPLY 1
SOLVED
Reply
Message 1 of 2
mucahid_tadik
175 Views, 1 Reply

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

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

Tags (2)
1 REPLY 1
Message 2 of 2

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;

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report