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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Delete creo files from folder

Sekar1
13-Aquamarine

Delete creo files from folder

Hi,

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,

Sekar

1 REPLY 1
sully7
14-Alexandrite
(To:Sekar1)

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 -  http://www.cplusplus.com/reference/cstdio/remove/ 

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.

 

Thanks, 

James Sullivan

President & Founder
CadActive Technologies - www.cadactive.com
Announcements


Top Tags