Eng-Tips is the largest forum for Engineering Professionals on the Internet.

Members share and learn making Eng-Tips Forums the best source of engineering information on the Internet!

  • Congratulations JStephen on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Femap API Error "Type mismatch"

Status
Not open for further replies.

vvk_187

Student
Joined
Dec 11, 2024
Messages
8
Hi, Where is the mistake?



Code:
 pNodeSet.AddAll(zDataType.FT_NODE);
            pNodeSet.Debug();

            int nodeCount = pNodeSet.Count();
            Console.WriteLine("nodeCount =" + nodeCount);
            Console.ReadKey();
            
            int nodeID;
            object XYZ;
            object wpXYZ;
            double[] outwpXYZ = new double[3];
            

            while (pNodeSet.Next()>0)
            {
                   nodeID = pNodeSet.CurrentID;
                   Console.WriteLine("nodeID =" + nodeID);
                   Console.ReadKey();
                    
                                    
                     pNode.Get(nodeID);
                     XYZ = pNode.xyz;
                    
                    
                    pModel.feCoordToWorkplane(XYZ, out wpXYZ);


                    outwpXYZ = (double[])wpXYZ;
                  
                  Console.WriteLine("nodeID=" + nodeID + " X=" + Math.Round(outwpXYZ[0], 2) + " Y=" + Math.Round(outwpXYZ[1], 2));
                  Console.ReadLine();
                

            }
 
Solution
Thanks for the response.
This line gave an error
pModel.feCoordToWorkplane(XYZ, out wpXYZ);
Fixed everything by adding an object variable to the loop before the function and zeroing it.
object wpXYZ=null;
The question can be considered closed
i'm not too versed in the C API, only femap's native BASIC and the python API, but what line is giving you the type mismatch?

also it seems this is not the full code, but an excerpt
 
Last edited:
Thanks for the response.
This line gave an error
pModel.feCoordToWorkplane(XYZ, out wpXYZ);
Fixed everything by adding an object variable to the loop before the function and zeroing it.
object wpXYZ=null;
The question can be considered closed
 
Solution
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top