cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

ProParameterDelete Bulk Item

ptc-767566
4-Participant

ProParameterDelete Bulk Item

I am using Creo Parametric Release 10.0 and Datecode10.0.8.0

on a bulk item P
ProMdlType::PRO_MDL_PART
ProMdlsubtype::PROMDLSTYPE_BULK
ProParameterDelete returns PRO_TK_GENERAL_ERROR

This same code works fine on parts.

The UI can delete these parameters. I am a bit lost as to why i cannot delete them. If i am suppose to be able to delete these, i will create a mini project and share the source.

6 REPLIES 6

@ptc-767566,

Please share sample code and if possible sample model to re-produce the issue. 

ptc-767566
4-Participant
(To:rghadge)

This gets a bit stranger.  I created a simple application to do just this one thing.  The actual delete is part of a large project.  To make testing it easy, i created the parameter, and then deleted the parameter.  This was successful.  I assumed I just had some bug in my old code.  I didn't move on to trying to fix this issue directly.  I removed the create logic, created the parameter via the UI and then ran it.  At that point I could not delete the parameter. 

////create value
//ProParamvalue paramValue;
//status = ProParamvalueSet(&paramValue, L"delete me", ProParamvalueType::PRO_PARAM_STRING);
//if (status != ProErrors::PRO_TK_NO_ERROR)
//{
// ProMessageDisplay(MSGFILE, "xyz123 error", L"Failed to Create parameter value.", &status);
// ProMessageClear();
// return status;
//}
 
//ProMessageDisplay(MSGFILE, "xyz123 value");
//ProMessageClear();
 
 
////create parameter
//ProParameter createdParam;
//status = ProParameterWithUnitsCreate(&v_ModelItem, PARAMNAME, &paramValue, nullptr, &createdParam);
//if (status != ProErrors::PRO_TK_NO_ERROR)
//{
// ProMessageDisplay(MSGFILE, "xyz123 error", L"Failed to Create parameter.", &status);
// ProMessageClear();
// return status;
//}
 
//ProMessageDisplay(MSGFILE, "xyz123 created", PARAMNAME);
//ProMessageClear();
 
 
ProParameter param;
status = ProParameterInit(&v_ModelItem, PARAMNAME, &param);
if (status != ProErrors::PRO_TK_NO_ERROR)
{
ProMessageDisplay(MSGFILE, "xyz123 error", L"Unable to find parameter.", &status);
ProMessageClear();
return status;
}
 
ProMessageDisplay(MSGFILE, "xyz123 found", PARAMNAME);
ProMessageClear();
 
status = ProParameterDelete(&param);
if (status != ProErrors::PRO_TK_NO_ERROR)
{
ProMessageDisplay(MSGFILE, "xyz123 error", L"Unable to delete parameter.", &status);
ProMessageClear();
return status;
}
 
ProMessageDisplay(MSGFILE, "xyz123 deleted", PARAMNAME);
ProMessageClear();

@ptc-767566,

Please log a new case with PTC Technical Support to get this addressed and confirm whether this is working as expected or a defect with API.

RPN
17-Peridot
17-Peridot
(To:ptc-767566)

As far I remember a Bulk item is NOT a part (PRO_MDL_PART), it is just a plain feature. 

ptc-767566
4-Participant
(To:RPN)

Working on supplying a simplified test.  Here is the part about types:

ProMdlType v_ModelType;
status = ProMdlTypeGet(v_Model, &v_ModelType);
if (status != ProErrors::PRO_TK_NO_ERROR)
{
ProMessageDisplay(MSGFILE, "xyz123 error", L"Unable to get model type", &status);
ProMessageClear();
return status;
}
 
ProMessageDisplay(MSGFILE, "xyz123 valueint", L"ProMdlType", &v_ModelType);
ProMessageClear();
 
ProMdlsubtype v_ModelSubType;
status = ProMdlSubtypeGet(v_Model, &v_ModelSubType);
if (status != ProErrors::PRO_TK_NO_ERROR)
{
ProMessageDisplay(MSGFILE, "xyz123 error", L"Unable to get model sub type", &status);
ProMessageClear();
return status;
}
 
ProMessageDisplay(MSGFILE, "xyz123 valueint", L"ProMdlsubtype", &v_ModelSubType);
ProMessageClear();


Running this produces:
ProMdlType has value 2
ProMdlsubtype has value 1

ProMdlType -> PRO_MDL_PART = PRO_PART, -> PRO_PART = 2,
ProMdlsubtype -> PROMDLSTYPE_NONE = 0,
PROMDLSTYPE_BULK, -> which means this is a part and a sub type of bulk

I would agree these feel just like a feature in the assembly, but they are something more.



RPN
17-Peridot
17-Peridot
(To:ptc-767566)

It may depend on your template. It seems that the bulk template parameter can't be deleted.

 

ps_modelitem mi

mi config -id 40 -typ feat

ps_param set -at mi -- myparam string hello

 

 

bultparam.png

 

As you see, the feature param appears in the component param info.

The locked one seems to be special, for this you may have to setup your own bulk part. I wasn't able to delete them as well.

But these locked one appear in the model parameter list, so you have to be carefully setup your bulk part, and 

 

With

ps_param set -model BLK0001.PRT mysolidparam int 5

and on open the Part I see this parameter

bulkmodelparam.png

But this one is NOT displayed at component level AND at part level which is strange. And the lock info is not displayed as well. So it is a bit of playing lottery 😅 but at feature level the lock state is reported via Toolkit and you will get LOCKED!

 

set ParamObj [ps_param list -at mi MODELED_BY]

ParamObj cget -lock

# Will return 

-> LOCKED

 

 

 

 

 

 

 

 

Announcements

Top Tags