Skip to main content
1-Visitor
September 21, 2017
Solved

Toolkit : File versioning + How to check if file/Model is active or opened in Creo

  • September 21, 2017
  • 1 reply
  • 2319 views

Hi,

 I need to userdtand how creo treats files.

Lets say there are two file for Part

1. FirstPart.prt 

2. FirstPart.prt.2

then which file creo uses to open the Model FirstPart?

 

I want to update a model using Toolkit and before that

I must check if specific model is already opened in Creo or not? 

Could someone tell me which function to use?

Best answer by Madhavi

@lhoogeveen Thanks for the reply! 

The explanation gave was helpful. 🙂

In Creo (recent files's list) you see the file name without version.

Same is when we open the model from Toolkit; we just need to give the filename without version. So that made me think what happens if there is a file with ext but without version.

 

I was playing with few files recently and yes it always takes the latest version.

Well about the second quetion:

fucntion ProSessionMdlList can be used to get list of all open models.

And if we need to check for specific model then just get this list and see if our model is there or not.

That is what I am going to use as a solution.

FYI: ProMdlModificationVerify() would check if the model was modified from last save or not.

 

1 reply

17-Peridot
September 21, 2017

Hopefully this example helps:

Create and Save part1.prt to Working Directory location (Windows file created as part1.prt.1)

Modify and Save part1.prt to Working Directory location (Windows file created as part1.prt.2)

Close Part1 and Erase Not Displayed

Open part1.prt from Working Directory location (part1.prt.2 will get opened into Creo)

Modify and Save part1.prt to Working Directory location (Windows file created as part1.prt.3)

 

If you take the initial part1.prt.1 and manually change it to part1.prt.4, this is the file that Creo would open next time. Creo looks for the highest number.

 

You should verify this with your own testing.

 

You can see how a folder could quickly become quite large and full of old copies of files. Creo's purge funtionality is a great way to keep only the latest files availalble if you want to purge/delete all the old copies.

 

No idea about your Toolkit question.

Madhavi1-VisitorAuthorAnswer
1-Visitor
September 22, 2017

@lhoogeveen Thanks for the reply! 

The explanation gave was helpful. 🙂

In Creo (recent files's list) you see the file name without version.

Same is when we open the model from Toolkit; we just need to give the filename without version. So that made me think what happens if there is a file with ext but without version.

 

I was playing with few files recently and yes it always takes the latest version.

Well about the second quetion:

fucntion ProSessionMdlList can be used to get list of all open models.

And if we need to check for specific model then just get this list and see if our model is there or not.

That is what I am going to use as a solution.

FYI: ProMdlModificationVerify() would check if the model was modified from last save or not.

 

Madhavi1-VisitorAuthor
1-Visitor
September 25, 2017
Other option to check whether model is opened or not is: ProMdlWindowGet()