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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

ProCurrentWorkspaceExport - How to cleanup session before use

fpradier-2
10-Marble

ProCurrentWorkspaceExport - How to cleanup session before use

Hi all,

 

I've a Pro/Toolkit application that makes some stuff and store workspace content at the end.

Everything works fine except when a model stay in Creo session bacause ProCurrentWorkspaceExport() does'nt support this (Toolkit doc) and return a PRO_TK_E_BUSY (-38) code

I'm trying to remove all model from memory but at least one stay in session

I've tried various functions and tricks:

 * ProSessionMdlList + ProMdlErase

 * ProSessionMdlList  + ProMdlEraseAll

 * ProEventProcess() => Forbiden

 * ProMdlEraseNotDisplayed()

 * Start another DLL that remove objects

 * Start another DLL that runs macro to erase not displayed objects

I could try to launch another Java app but not sure that it's work (I'll do that waiting your answers...)

 

Any idea will be appreciate 🙂

 

Regards,

 

Fred

 

1 REPLY 1

Well it is difficult if your application is syncronous.

You must have observed this already so just FYI:

All your actions takes place when control goes back to Creo.

So if you want to 1. Close/clear a model 2. do some stuff and 3. re-open it
then it will do all that but your re-opened model might get closed/cleared when you return to creo.

 

Well if you just want to clear the session then I'd like to suggest this

1. Close the window of model

2. make sure its not been used by any other model (like drawing other wise you will need to close the drawing first) and then

3. erase the model from session.

 

Hope that help!

If you find better solution then please share!

Madhavi

 

Announcements


Top Tags