I use the following code to get an instance or create an instance of Inventor:
Set oINVApp = GetObject(, "Inventor.Application") If (err) Then err.Clear Set oINVApp = CreateObject("Inventor.Application") Do While (Not INVReady) Sleep (1000) DoEvents If (oINVApp.Ready) Then INVReady = True Sleep (2000) End If Loop End If
The problem I have is that Inventor has a tendency to crash. Quite often
For some reason oINVAPP is still linked to something, though I don't know what. Whatever I do to the oINVAPP object, just happens and my code believes it has happpened as expected.
I need somehow to detect that oINVAPP is no longer an instance of Inventor. If I test oINVAPP for Nothing it returns false, so something is going on. Firstly is this a bug? Surely if this has crashed then something ought to be cleared??
Secondly, and more importantly, how can I detect this? If I can't test oINVAPP for being nothing, what can I do to determine that Inventor has crashed?
Any help is appreciated.
Hi,
I don't think these sort of issues would be specific to Inventor, but could be reproduced with other applications registering themselves in the Running Object Table, like all the MS products.
So you debug into the code which is controlling Inventor and none of the functions on it set the Err object?
Did you check if another instance of Inventor maybe still running in the background that your Inventor.Application object is connected to? - when you create an Inventor.Application object it's kept invisible by default.
Maybe the crashed application is still registered in the Running Object Table (ROT) for some reason. You might find some viewers on the net which can help you with that. But then I think calling any functions on the object would return an error since they cannot communicate with the program.
Cheers,