Error code 945001
Error code 945001
(OP)
Hello all,
I am trying to create a .dll using NX Open to create surface. I wrote a function which returns the error 945001. I am not able to find out what error 945001 actually is. Below is the function code. This function accepts an array of points and creates a spline from those points and returns the control points of the spline. I am calling this dll from a console application.
//////////////////////////////////////////////////////////////
std::vector<Points> GetCtlPoints(double ptArray[][3], int size)
{
std::vector<Points> splineControlPoints;
std::vector<NXOpen::Point3d> Points;
SPLINE_FIT_t tFitSplineData; // Spline Curve Structure
double dMaxErr = 0.0; // Maximum err value
double dTolerance = 0.0001; // Default Tolerance value
tag_t tGeometry = NULL_TAG; // Tag of the geometry
NXOpen::Point3d Pt(0,0,0); // Instance to point class
bool bIsFeature = false;
for(int i=0; i<size; i++)
{
Pt.X = ptArray[i][0];
Pt.Y = ptArray[i][1];
Pt.Z = ptArray[i][2];
Points.push_back(Pt);
}
tFitSplineData.weights = NULL;
tFitSplineData.num_of_weights = 0;
tFitSplineData.weight_positions = NULL;
tFitSplineData.num_of_segments = 0;
tFitSplineData.tolerance = 0.0001;
tFitSplineData.degree = 3;
tFitSplineData.num_of_points = Points.size();
// error code
int nErrorCode=0;
int nPt=0;
// allocate memory
tFitSplineData.points = (double*) malloc(3*(Points.size())*sizeof(double));
// copy data to UF Array
for (nPt = 0; nPt < Points.size(); nPt++)
{
double dTempPt[3] = {Points.at(nPt).X, Points.at(nPt).Y, Points.at(nPt).Z};
tFitSplineData.points[nPt*3+0]=dTempPt[0];
tFitSplineData.points[nPt*3+1]=dTempPt[1];
tFitSplineData.points[nPt*3+2]=dTempPt[2];
//UF_VEC3_copy(dTempPt, &tFitSplineData.points[nPt*3]);
}
// no slope
tFitSplineData.slope_flag = 0; // No Slope exists
tFitSplineData.slopes = NULL;
// Create Fit Spline with the above structure filled
UF_CALL (UF_MODL_create_fitted_spline(&tFitSplineData, &dMaxErr, &nErrorCode, &tGeometry) );
// Free the memory and lists
// Some code to get control points from the fitted spline
return splineControlPoints;
}
//////////// ERROR ///////////////////////
*** ERROR system never initialised, sending output to stderr ***
*** ERROR code 945001 at line 196 in NX8_Open2.cpp:
+++ NO error text found for error 945001
UF_MODL_create_fitted_spline(&tFitSplineData, &dMaxErr, &nErrorCode, &tGeometry);
*** ERROR code 945001 at line 196 in NX8_Open2.cpp:
+++ NO error text found for error 945001
UF_MODL_create_fitted_spline(&tFitSplineData, &dMaxErr, &nErrorCode, &tGeometry);
Could anybody please help me understand what I may be missing here?
Is there a comprehensive documentation of error codes and what each error code means ?
Thanks in advance
Wilson





RE: Error code 945001
Not that I know of...
www.nxjournaling.com
RE: Error code 945001
Line 196 : UF_CALL (UF_MODL_create_fitted_spline(&tFitSplineData, &dMaxErr, &nErrorCode, &tGeometry) );
RE: Error code 945001
more info :
There is no compile time error. At runtime, the console window (console app that calls this dll) shows the above message. Program returns from the dll function without error.
RE: Error code 945001
CODE
www.nxjournaling.com
RE: Error code 945001
www.nxjournaling.com
RE: Error code 945001
RE: Error code 945001
Thanks a ton Cowski and Bleaker.
I was missing the initialization, hence the error. Now I see the application running after adding UF_initialize()
RE: Error code 945001
Is there a way to get the control points of a spline created through
UF_CALL (UF_MODL_create_fitted_spline(&tFitSplineData, &dMaxErr, &nErrorCode, &tGeometry) );
I have the tGeometry. Can this be casted to any spline class which can return the control points.
RE: Error code 945001
Now, to your question - whereas downcasting to try and get the data that isn't there is guaranteed to fail, on the off chance that it was secretly put there by crafty NX devs, you can still try it with:
NXOpen::Spline *foo = dynamic_cast<NXOpen::Spline*>(NXOpen::NXObjectManager::Get(tGeometry)); // Don't forget the necessary includes like spline.hxx
Please don't hold me liable if (or rather, when) your computer explodes spectacularly or turns into a giant flesh-eating monster as a result of this heresy.