Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
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.
@ptc-767566,
Please share sample code and if possible sample model to re-produce the issue.
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.
@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.
As far I remember a Bulk item is NOT a part (PRO_MDL_PART), it is just a plain feature.
Working on supplying a simplified test. Here is the part about types:
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
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
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