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: 

TransMatrix.SetCoordinateSystem vb to c# conversion error

1 REPLY 1
SOLVED
Reply
Message 1 of 2
herrwolf1
458 Views, 1 Reply

TransMatrix.SetCoordinateSystem vb to c# conversion error


Hello,

I'm trying to convert some vb.net code (that works) to c# code. I'm having a bit of trouble with the following.

1st is the vb.net code that gives me no trouble.

2nd is the c# code that gives me the errors.

3rd are the errors thrown by Visual Studio 2010.

 

Thank you in advance for any assistance you can offer.

 

                Dim oZVector As UnitVector = oTG.CreateUnitVector(oViewCamera.Eye.X - oViewCamera.Target.X, _
                    oViewCamera.Eye.Y - oViewCamera.Target.Y, oViewCamera.Eye.Z - oViewCamera.Target.Z)

                Dim oYVector As UnitVector = oViewCamera.UpVector

                Dim oXVector As UnitVector = oYVector.CrossProduct(oZVector)

                Dim oTransMatrix As Matrix = oTG.CreateMatrix
                oTransMatrix.SetCoordinateSystem(oTG.CreatePoint(0, 0, 0), oXVector.AsVector, oYVector.AsVector, oZVector.AsVector)

 

Here is the c# code that doesn't work.

 

                UnitVector oZVector = oTg.CreateUnitVector(viewCamera.Eye.X-viewCamera.Target.X, viewCamera.Eye.Y - viewCamera.Target.Y, viewCamera.Eye.Z - viewCamera.Target.Z);

                UnitVector oYVector = viewCamera.UpVector;

                UnitVector oXVector = oYVector.CrossProduct(oZVector);

                // Create a matrix.
                Matrix transMatrix = oTg.CreateMatrix();

*Error 5*   transMatrix.SetCoordinateSystem(oTg.CreatePoint(0, 0, 0),  oXVector.AsVector, oYVector.AsVector, oZVector.AsVector);

 

Here are the errors I keep getting.

 

Error    5    The best overloaded method match for 'Inventor.Matrix.SetCoordinateSystem(Inventor.Point, Inventor.Vector, Inventor.Vector, Inventor.Vector)' has some invalid arguments


Error    6    Argument 2: cannot convert from 'method group' to 'Inventor.Vector


Error    7    Argument 3: cannot convert from 'method group' to 'Inventor.Vector


Error    8    Argument 4: cannot convert from 'method group' to 'Inventor.Vector



 

1 REPLY 1
Message 2 of 2
herrwolf1
in reply to: herrwolf1

problem solved:

 

transMatrix.SetCoordinateSystem(oTg.CreatePoint(0, 0, 0),   oXVector.AsVector(), oYVector.AsVector(), oZVector.AsVector());

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

Post to forums  

Autodesk Design & Make Report