We have an Inventor API application that runs in a headless/server mode where there is no user to respond any error situations that occur. I specify "silent mode" when I instantiate the Inventor application object.
ThisApplication = CreateObject(
ThisApplication.SilentOperation = True
"Inventor.Application")
However, occasionally we get errors that will display a message box requiring user interaction, and of course this hangs our server process until someone responds.
For example, if we attempt to overwrite a file with SaveAsCopy() and another process has a lock on the file, it will hang. I'd prefer it to just throw an exception that my application can handle accordingly.
Any help will be appreciated.
Thanks
Mike
Solved! Go to Solution.
Solved by MikeGillam5072. Go to Solution.
A workaround is to add a check in your code before calling SaveAsCopy. The check can be:
1. Detect if a file with the same name you want to use already exists in the folder.
2. If it exists, try to delete the file.
3. If fail to delete the file, you can handle this exception and need not to call the SaveAsCopy.
Hope this helps.