Changing parameters value in a loop
Hi,
I am very new to pro/toolkit development.
I have a set of parameters list with its new value defined in a txt file.
I read the txt file and store the parameters in a structure array (dataConfig) varaible.
Now, I want to iterate through the structure and change the parameter value to the new value.
The value of the last parameter comes in the iteration is only getting changed.
Can some one guide me on this.
My code:
//Main function
for (i=0; i<cfgcnt; i++)<br="/>{
err = ChangeParameter (dataConfig[i].paramName, dataConfig[i].newValue);
}
ProError ChangeParameter (char name[100], char value[100])
{
ProName tBuf[100];
ProMdl p_model;
ProModelitem p_mdl_item;
ProError err;
ProParameter param;
ProParamvalue param_value;
ProError status;
ProMdlCurrentGet (&p_model);
ProMdlToModelitem(p_model, &p_mdl_item);
ProStringToWstring (tBuf, name);
status = ProParameterInit(&p_mdl_item, tBuf, ¶m);
if (status == PRO_TK_NO_ERROR)
{
ProStringToWstring (tBuf, value);
ProParamvalueSet (¶m_value, tBuf, PRO_PARAM_STRING);
status= ProParameterValueSet(¶m, ¶m_value);
}
return (status);
}
Thanks
Siva
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.

