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

Delete creo files from folder


Delete creo files from folder


I want to delete creo files from a particular folder.

Please let me know if any c++ toolkit api is available for this.


Thanks and regards,



In the context of your code, do you already know where the folder is? I don't believe that any of the Pro/TOOLKIT APIs have a specific "delete from folder" type function... but you could always use the windows APIs for this?


You would include your windows headers/libs. Then, collect files in the desired directory using "FindFirstFile" (usually "FindFirstFileW"). Alternatively, you could also collect files in the directory using the Pro/Toolkit function "ProFilesList".


From there, you could call "DeleteFile", (usually "DeleteFileW") on anything with a PRT, ASM, or DRW extension. or There's also obviously functionality inside of the c++ std lib too - 

So it really just depends on how "compliant" you are trying to be with C++ standards vs how much you want to leverage OS-specific methods:


Past that, if you are instead trying to "get" the directory of a model that is already loaded into Creo... you could get the path of the mode. If you are using Pro/TOOLKIT, I believe you can do that with "ProModel" (as opposed to ProMdl). If you are using Object Toolkit (OTK), you can do this with the pfcModelDescriptor.


Hope this helps.



James Sullivan

President & Founder
CadActive Technologies -
Attention: Creo 7.0 Customers
Please consider upgrading
End of Life announcement here.

NEW Creo+ Topics:
PTC Control Center
Creo+ Portal
Real-time Collaboration