Skip to main content
Inspiring
March 30, 2017
Answered

How to check if the project finished loading?

  • March 30, 2017
  • 1 reply
  • 535 views

Hi All,

I encountered into a following problem.

I would like to execute some batch operation on multiple projects, so I open the project from a path and run the operation set.

The issue, however, in the project loading time. The OpenProject function returns before the project completely loaded. Thus, when I try to save the project during the operation set it throws an AE error (can't delete file).

Any ideas on how I can get an indication that the projects loaded completely and I can proceed with my code?

Best regards,

Yuri

This topic has been closed for replies.
Correct answer kotuk81

Hi Shachar,

Thanks a lot once again.

I didn't tried all the options, but the opening the project via script is indeed a synchronous operation.

Though, there are some pitfalls:

- After opening the project via the script in the IdleHook, I've to "release" the process and continue the operation on the next IdleHook

- On the next IdleHook, I need to validate the project is ready by trying to acquire a handle. If I got no handle I need to "release" the process.

Best regards,
Yuri

1 reply

Community Expert
March 30, 2017

i'm merely guessing here, but you can try:

1. loading the project using AEGP_ExecuteScript(). perhaps in javascript

the operation is synchronous.

2. use AEGP_NumProjects. perhaps it's set to 0 while the project is loading.

3. perhaps AEGP_ProjectIsDirty returns "true" while loading.

kotuk81AuthorCorrect answer
Inspiring
April 27, 2017

Hi Shachar,

Thanks a lot once again.

I didn't tried all the options, but the opening the project via script is indeed a synchronous operation.

Though, there are some pitfalls:

- After opening the project via the script in the IdleHook, I've to "release" the process and continue the operation on the next IdleHook

- On the next IdleHook, I need to validate the project is ready by trying to acquire a handle. If I got no handle I need to "release" the process.

Best regards,
Yuri