WilsonBlr
Aerospace
- Jun 11, 2014
- 19
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:
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:
bool bIsFeature = false;
for(int i=0; i<size; i++)
{
Pt.X = ptArray[0];
Pt.Y = ptArray[1];
Pt.Z = ptArray[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