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: 

Rotation of Client Graphics C#

0 REPLIES 0
Reply
Message 1 of 1
Dev_rim
310 Views, 0 Replies

Rotation of Client Graphics C#

Hi everyone,

I just want the rotate a client graphic object. From its center and 90 degrees. But there is not any change in view.

 

Here is my code

            double PI = 3.14159265358979;
            AssemblyDocument asmDoc = (AssemblyDocument)invApp.ActiveDocument;
            AssemblyComponentDefinition asmCompDef = asmDoc.ComponentDefinition;
            TransientGeometry transientGeometry = invApp.TransientGeometry;
            ClientGraphics partPreview = asmCompDef.ClientGraphicsCollection["PartPreview"];
            GraphicsNode graphicsNode = partPreview.ItemById[partPreview.Count];
            Inventor.Camera cam = invApp.ActiveView.Camera;
            Matrix matrix = transientGeometry.CreateMatrix();
            Vector vector = cam.UpVector.AsVector();
            matrix.SetToRotation(PI / 2, vector, placementPoint);
          
            graphicsNode.Transformation.TransformBy(matrix);
            invApp.ActiveView.Update();

 

 

 

 

 

 

Is any wrong with my code?

Thanks.

If my answer is solved your problem, please mark it as Solution

Freundliche Grüße / Kind Regards
0 REPLIES 0

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report