Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

SaveAs Function In Pro/TOOLKIT App

apilikov

New member
Hi All.


I'm still trying to develop my PRO/TOOLKIT Appand here is the problem which I want you to ask. I'm developing the PRO/TOOLKITlibrary and my library is the complex decision for those who don't want to know how PRO/TOOLKIT really works. In my library I'm trying to implement SaveAs function and I coundn't foresee that this is such a problem. The PRO/TOOLKITdoesn't have function ProMdlSaveAs though it would be excellent. So I must use the resources that I have. I found 2 functions which are perfoming the similar function. Here are them: ProMdlCopy and ProMdlfileCopy. As fo me these functions are working very strange. If you are trying to feed ProMdlCopywith the same model names but different paths (the ussual situation as I think) it returns the same model pointer thinking that this is is the same model. And here as the question. Now I'm working as follows. I'm getting the full model path by ProMdldataGet function and then using WIN32 API I simply copy the file in the my new destination. Then I close the source model by ProMdlErase() and open the copied file by function ProMdlRetrieve() . It is working but this is very inconveniently and require a lot of code. And what is the main problem. It works not always and I can't understand why.


Help me please... I'm really in deadlock.


Anatoly
 
You have a very valid point. I faced similar issues.

I could successfully use ProMdlBackup for copy operation.
Just create a new ProMdldata containing new path and it should copy the model. It is better to use back up as this takes care of copying all dependents of assembly also.

Strangely, there is no API to give you full path of current opened model. You have to recreate it from its ProMdldata. But, there too, you can run in to issues as it does not contain complete information for network UNC paths. It will work for local disk path fine.
 
In Pro/E when you do a save asyou have to give the model a new name. You can't do a save as to a new folder with the same name like other programs. So that's the way ProMdlCopy works - same behaviour as interactive Pro/E.
 
Thank you very much. I really did not notice this function because in other CADs I haven't met the word "Backup" in the meaning of the "save as with the same name". Pro/E - it is always something interesting. :)
 
Yes, The proper function for SaveAs doesn't exist. It is still a problem when you wish to SaveAs a different name the entire assembly with different name in same directory.





I have used the functions ProMdlDirectoryChange & ProMdlRename quite effectively to do this. Atleast i feel comfortable with that rather than writing win apps.





You open the file, chnage direcotry, then rename, change directory bak to original and then Save the model. It will make a copy in the same working direcroyt
 
rakeshb said:
Yes, The proper function for SaveAs doesn't exist. It is still a problem when you wish to SaveAs a different name the entire assembly with different name in same directory.





I have used the functions ProMdlDirectoryChange & ProMdlRename quite effectively to do this. Atleast i feel comfortable with that rather than writing win apps.





You open the file, chnage direcotry, then rename, change directory bak to original and then Save the model. It will make a copy in the same working direcroyt


Ok. So you want to say that ProMdlSave always perfom saving in the Pro/E working directory? If it is, my problem becomes much more easy.
 

Sponsor

Articles From 3DCAD World

Back
Top