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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Creo Toolkit using C

Madhavi
12-Amethyst

Creo Toolkit using C

How to fetch an Unique ID for .Prt, .Asm, drawing?

10 REPLIES 10

They should have a unique id (name + extension/type). If they haven't you have a problem inside your data management. Creo need a unique identifier and uses for this the filename.

 

If you have problems with doubled files you can generate a unique ID by getting the hash value from the file or something like that. 

 

Br,

Eike

Thanks for reply Eike!

Yah there has to be  unique ID for each file (part,asm,drawing). As if  now I have not found any.

I have tried ProMdlIdGet but it's not persistent between sessions.

If I generate my own unique ID then I will need to add/attach it as a property to the part (or asm/drawing) and later I have to write a fucntion which will return the Part for given unique id.

Pro toolkit is in use for so long and I am sure people must have faced this situation.

I was wondering how did they handle it.

 

Regards,

Madhavi

As mentioned before ... the filename is the unique id.

 

If you have doubled file names it is not possible to work with Creo with both files at the same time. So the filename should be unique inside your system. If you have PDM/PLM - Windchill it is unique.

 

If you have multiple files with same name (you have a big problem inside of creo with this) or same instance names (same big problem) than you need to find a way for another unique ID (not supported by Creo). You could create one and write it inside a parameter.

 

Br,

Eike

Thanks once again for the updates.

I do not have Windchill and yes I have multiple files with same name (for example PRT0001.prt).

But yes FullFileName (Path + file name with ext) would be unique. Not sure if it's accepted solution or not.

 

So I am planning to add new parameter with value as unique GUID. Now looking for "how to add new Parameter". Please let me know if you know any function.

 

If not then I would have to use existing Parameter for this. 

 

Regards,

Madhavi

 

ProParameterCreate

ProParameterWithUnitsCreate

 

Br,

Eike

Oh that was quick reply.

And which function/s will allow me to find "part/Asm/Drawing" using this Parameter with specified GUID?

o.O Did you know Creo?

 

Just create a user parameter on a Model (could be current model) and finish ... or if you want to rework all models automatically build an async. application or use an application that is already on the market like:

 

B&W Smart Update

INNEO Solutions Model Processor

 

Both can rework a list of models, create parameter and fill them with listed values.

 

Br,

Eike

I am totally new to Creo and the Toolkit.

I can create a param. and attach it to Part(model).

Lets say I have 5 parts and I have assigned one GUIDs to each part and saved it.

Now thing is : using toolkit I want to find the correct part for selected guid and update part's few properties.

Right now I just know  ProMdlFiletypeLoad to load a model.

I think this would be a very very bad idea to solve your problem ... better are renamings to get on a good base. Else you need to load all models to find the right one. And you can't load two model with the same name inside the same Creo Session. 

 

Br,

Eike

I am going to use full file name along with extention as a unique id. And I would add GUID just as a second level of filter.

Announcements


Top Tags