Skip to main content
1-Visitor
April 6, 2021
Question

ProParamvalueValueGet

  • April 6, 2021
  • 1 reply
  • 1123 views
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)

    1 reply

    RPN
    18-Opal
    April 6, 2021

    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;

    ...