Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi, i tried to get feature parameter via toolkit api.
this code i used.
ProError status = PRO_TK_NO_ERROR;
ProSelection *sels;
ProModelitem mdltem;
ProParameter param;
ProParamvalue proval;
//ProMdl mdl;
int nSels;
status = ProSelect( "feature", 1, NULL, NULL, NULL, NULL, &sels, &nSels);
if (nSels < 1 || status != PRO_TK_NO_ERROR)
{
return status;
}
ProSelectionModelitemGet(sels[0],&mdltem);
status = ProParameterInit(&mdltem,L"DISTANSE",¶m);
if(status == PRO_TK_NO_ERROR)
{
ProParameterValueGet(¶m, &proval);
sprintf(FileC,"distance : %f",proval.value.d_val);
ProMessageDisplay(MSGFIL,"USER %0s",FileC);
}
else
{
ProMessageDisplay(MSGFIL,"USER %0s","No Distance");
}
return status;
ProParameterInit appears to be able to fetch only the parameters for the model (ProMdl for parts, assemblies, etc.).
How do I get the parameters of a feature?
Solved! Go to Solution.
Sorry, i misspelling DISTANSE ..
i change parameter name from DISTANSE to DISTANCE.
and then i got the feature parameter value.
Sorry, i misspelling DISTANSE ..
i change parameter name from DISTANSE to DISTANCE.
and then i got the feature parameter value.