cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ProFeatureDimensionVisit exe and dll output is different

ptc-601014
Newbie

ProFeatureDimensionVisit exe and dll output is different

All,

Just when I thought I was finished, I compiled my dll and it give a different output than my exe. Specifically... ProFeatureDimensionVisit - exe output is different than dll output...exe outputs correct value. dll outputs 0 when -1 is encountered on ProDimensionTypeGet. Code follows:

Any ideas?

function call:
status=ProFeatureDimensionVisit (&feat, collectHoleTolsAndQtys, NULL, (ProAppData) &tolInfo);

function:
/*=============================================================*\
Function: collectHoleTolsAndQtys
Purpose: check each dimension for tolerance
\*=============================================================*/
ProError collectHoleTolsAndQtys (ProDimension* dimension, ProError error_status, ProAppData app_data)
{
double low_limit, up_limit, dif_limit;
ProCharLine ctext;
ProLine *text;
ProDimToleranceType tol_type;
char* tol_string;
tolStruct *tolInfo;
tolInfo = (tolStruct *)app_data;
ProDimensiontype dimType;

cout<<"dimension id : "<<dimension->id<<endl;<br/>
//get the dimension type

//PRODIMTYPE_UNKNOWN = -1, /* ((== DIM_TYPE_UNKNOWN))
//PRODIMTYPE_LINEAR = 9, /* ((== DIM_LINEAR ))
//PRODIMTYPE_RADIUS = 3, /* ((== DIM_RAD ))
//PRODIMTYPE_DIAMETER = 4, /* ((== DIM_DIA ))
//PRODIMTYPE_ANGLE = 21 /* ((== DIM_ANGULAR ))
error_status = ProDimensionTypeGet (dimension, &dimType);
cout<<"dimension type: "<<dimtype<<endl;<br/> //if there's an error
if (error_status != PRO_TK_NO_ERROR)
{
cout << "failed ProDimensionTypeGet in collectHoleTolsAndQtys: for dimension id :"<< dimension->id << endl;
return PRO_TK_NO_ERROR;
}//end if
else
{
//if it's a diameter
//get and set the diaTolType, diaTolPlus, diaTolMinus
if (dimType == PRODIMTYPE_DIAMETER)
{
error_status = ProDimensionToltypeGet (dimension, &tol_type);
if (error_status != PRO_TK_NO_ERROR)
{
cout << "failed ProDimensionToltypeGet in collectHoleTolsAndQtys: " << endl;
return PRO_TK_NO_ERROR;
}//end if

else
{
cout<<"tol_type in collectHoleTolsAndQtys " << tol_type <<endl;<br/> tolInfo->diaTolType=tol_type;
//check each dimension for tolerance
error_status = ProDimensionToleranceGet (dimension, &up_limit, &low_limit);
if (error_status != PRO_TK_NO_ERROR)
{
printf("Failed to ProDimensionToleranceGet in collectNonHoleTolsAndQtys: %d \n", error_status);
return PRO_TK_NO_ERROR;
}
else
{
cout<<"tolInfo->diaTolPlus in collectHoleTolsAndQtys " << tolInfo->diaTolPlus <<endl;<br/> cout<<"tolInfo->diaTolMinus in collectHoleTolsAndQtys " << tolInfo->diaTolMinus <<endl;<br/> cout<<"up_limit " << up_limit <<endl;<br/> if((tolInfo->diaTolPlus > up_limit) || (tolInfo->diaTolPlus==0))
{


tolInfo->diaTolPlus=up_limit;
tolInfo->diaTolMinus=low_limit;
cout<<"adding tolInfo->diaTolPlus in collectHoleTolsAndQtys " << tolInfo->diaTolPlus <<endl;<br/> cout<<"adding tolInfo->diaTolMinus in collectHoleTolsAndQtys " << tolInfo->diaTolMinus <<endl;<br/> }//end if
}//end else
}//end else
}//end if (dimType == PRODIMTYPE_DIAMETER)

//if dimension is not a diameter, get the tightest dimension tolerance and apply it to all locations
else{
error_status = ProDimensionToltypeGet (dimension, &tol_type);
if (error_status != PRO_TK_NO_ERROR)
{
cout << "failed ProDimensionToltypeGet in collectHoleTolsAndQtys: " << endl;
return PRO_TK_NO_ERROR;
}//end if

else
{
//see if the existing position tolerance is tighter (less than) this tolerance,
//replace it...otherwise leave the existing
if((tolInfo->diaTolPlus > up_limit) || (tolInfo->diaTolPlus==0))
{
//cout<<"tol_type in collectHoleTolsAndQtys " << tol_type <<endl;<br/> tolInfo->posTolType=tol_type;
//if tol_type is +/-, set upper and lower
//if it's symmetric, set sym
//check each dimension for tolerance
error_status = ProDimensionToleranceGet (dimension, &up_limit, &low_limit);
if (error_status != PRO_TK_NO_ERROR)
{
printf("Failed to ProDimensionToleranceGet in collectNonHoleTolsAndQtys: %d \n", error_status);
return PRO_TK_NO_ERROR;
}
else
{
tolInfo->posTolPlus=up_limit;
tolInfo->posTolMinus=low_limit;
}
}
}//end else
}//end else
}//end else
return PRO_TK_NO_ERROR;
}

This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Announcements