Thank you to my friends Matthias and Wolfgang,
According to offer you the information, I found in the preservation, if the model objects have contents name, CreoElementsDirectModeling contents is used the name as a disk file name to save. If not, the file is saved on disk using the same string as the base name.
And save, only changed the contents name save again, CreoElementsDirectModeling will use the new contens name save a new file on disk. Otherwise, the file name on disk will always be the string from the first save.
I've now solved the problem with version names when saving files using the following method
1. The name of the file object to iterate over the save path (eFileName)
2. Lookup the name of the modified model object (mObjName)
3. Check if mObjName exists a file with the same name in the disk path
3.1. Rename the disk file name (incrementing the version number) if a disk file with the same name exists
3.2. If no disk file with the same name exists, no action is taken.
4. Save the modified model object (use mObjName).
There are still two problems with this,
An error if a model object with the same name exists in the drawing environment,
b. If you change the contents name and save it again, you cannot trace the historical version by the file name.
I will continue to work on how to solve this problem. If you have a way to trace back to a historical version without a common file name, please let me know. Thank you again.
------------------
A mechanical engineer who loves to program
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP