ProParamvalueValueGet
Apr 06, 2021
07:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Apr 06, 2021
07:21 AM
ProParamvalueValueGet
I am using Creo Parametric 4.0 M040
Not able to fetch the value(d_val) from the ProParamvalueValueGet, I am able to see the value in the visual studio while debugging but printing the value is causing issue and getting return as 0.000.
ProCableparam *spoolParams = NULL;
int spoolParamQty = 0;
status = ProSpoolParametersCollect(&spools[h], &spoolParams);
status = ProArraySizeGet(spoolParams, &spoolParamQty);
for (int j = 0; j < spoolParamQty; ++j)
{
status = ProSpoolParameterGet(spools, L"DENSITY", spoolParams);
double density=0.0;
static char line[500];
ProParamvalue proval;
status = ProParamvalueValueGet(((ProParamvalue*)&spoolParams[j].param_value.value.value.d_val), PRO_PARAM_DOUBLE, &density);
fprintf(lf, "\n density: %f\n", density);
Here are the errors that I faced
compiling perfectly but not getting the value(d_val)
Not able to fetch the value(d_val) from the ProParamvalueValueGet, I am able to see the value in the visual studio while debugging but printing the value is causing issue and getting return as 0.000.
ProCableparam *spoolParams = NULL;
int spoolParamQty = 0;
status = ProSpoolParametersCollect(&spools[h], &spoolParams);
status = ProArraySizeGet(spoolParams, &spoolParamQty);
for (int j = 0; j < spoolParamQty; ++j)
{
status = ProSpoolParameterGet(spools, L"DENSITY", spoolParams);
double density=0.0;
static char line[500];
ProParamvalue proval;
status = ProParamvalueValueGet(((ProParamvalue*)&spoolParams[j].param_value.value.value.d_val), PRO_PARAM_DOUBLE, &density);
fprintf(lf, "\n density: %f\n", density);
Here are the errors that I faced
compiling perfectly but not getting the value(d_val)
1 REPLY 1
Apr 06, 2021
05:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Apr 06, 2021
05:10 PM
There is so much demo code, you should have a closer look. What you do, will not work 😓
Spoiler
ProParamvalue value;
pars is the ProArray
for( i = 0; i < n; i++ )
{
value.type = PRO_PARAM_VOID;
status = ProParameterValueGet(&pars[i], &value);
// Wstring param name in pars[i].id
switch( value.type )
{
case PRO_PARAM_DOUBLE:
// Integer Value is in value.value.d_val
break;
...
