Documents.Open + TimeOut

Documents.Open + TimeOut

Anonymous
Not applicable
502 Views
3 Replies
Message 1 of 4

Documents.Open + TimeOut

Anonymous
Not applicable

Hi,

 

when i open a dcoument and its corrupet or something else

inventor hangs

how i can set a timeout value that inventor cancle the open request

 

 

thx for help or Sugesstions

 

Mario

 

inventor 2014 / .net 

 

0 Likes
503 Views
3 Replies
Replies (3)
Message 2 of 4

philippe.leefsma
Alumni
Alumni

Hi Mario,

 

Unfortunately I doubt there is a way to do so ... Inventor API is single threaded so if performing an action hangs Inventor there is hardly any way to cancel it.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hey Philippe,

 

I think about a timer

as example but i dosent now how exactly i can create a timer in this situation

 

 

==> Timer Start / Limit 10min

==> Load Document

==> when over 10min TaskKill Inventor.exe

 

any Hints or Tips for me Please

 

thx

Mario

 

 

0 Likes
Message 4 of 4

philippe.leefsma
Alumni
Alumni

Well if you want to use that approach, you would need to use an external exe that starts Inventor (or connects to a running instance), start a timer before opening a document, listen to some events, eg OnOpenDocument(kAfter) then kill Inventor.exe if it times up.

 

You should be able to find easily examples on the web on how to kill a process programmatically.

 

I hope it helps.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes