Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
by using proselection i can able to create component/feat parameters in assembly
but when i try to create a parameter instead of selection it will create either part or assembly level parameter.
Is there any option to create or edit Feat_Param in a component level in assembly.
///*****************WHILE USING BELOW CODE IT CREATES CORRECTLY****************************////////////////////
err = ProSelect("component", 1, NULL, NULL, NULL, NULL, &p_sel_array, &p_n_sels);
err = ProSelectionModelitemGet(*p_sel_array, &p_mdlitem);
err = ProParamvalueSet(&new_value, (void*)L"FIND_NUMBER", PRO_PARAM_STRING);
err = ProParameterCreate(&p_mdlitem, L"6", &new_value, &new_param);
instead of selection i need all components list in the assembly
/////*************************************//////////////////
/////*****************below code update parameter as assembly level********************//////////////////
status = ProDwgtableCellRefmodelGet(&table[0], 2, i, &proAssemblyRepeatRg, &proMdlRepeatRg);
ProMdlToModelitem(proAssemblyRepeatRg, &p_mdlitem);
err = ProParamvalueSet(&new_value, (void*)L"FIND_NUMBER", PRO_PARAM_STRING);
err = ProParameterCreate(&p_mdlitem, L"6", &new_value, &new_param);
////*************************************//////////////////
/////*****************below code update parameter as part level********************//////////////////
status = ProDwgtableCellRefmodelGet(&table[0], 2, i, &proAssemblyRepeatRg, &proMdlRepeatRg);
ProMdlToModelitem(proMdlRepeatRg, &p_mdlitem);
err = ProParamvalueSet(&new_value, (void*)L"FIND_NUMBER", PRO_PARAM_STRING);
err = ProParameterCreate(&p_mdlitem, L"6", &new_value, &new_param);
////*************************************//////////////////
Solved! Go to Solution.
DONE BY USING BELOW CODE
/***************************************
p_mdlitem.type = feature->type;
p_mdlitem.id = feature->id;
p_mdlitem.owner = feature->owner;
err = ProParamvalueSet(&new_value, (void*)L"3654", PRO_PARAM_STRING);
//err = ProParameterWithUnitsCreate(&p_mdlitem, L"FIND_NUMBER", &new_value, NULL, &new_param);
err = ProParameterCreate(&p_mdlitem, L"FIND_NUMBER", &new_value, &new_param);
//err = ProParameterCreate((ProModelitem*)&feature, L"FIND_NUMBER", &new_value, &new_param);
DONE BY USING BELOW CODE
/***************************************
p_mdlitem.type = feature->type;
p_mdlitem.id = feature->id;
p_mdlitem.owner = feature->owner;
err = ProParamvalueSet(&new_value, (void*)L"3654", PRO_PARAM_STRING);
//err = ProParameterWithUnitsCreate(&p_mdlitem, L"FIND_NUMBER", &new_value, NULL, &new_param);
err = ProParameterCreate(&p_mdlitem, L"FIND_NUMBER", &new_value, &new_param);
//err = ProParameterCreate((ProModelitem*)&feature, L"FIND_NUMBER", &new_value, &new_param);