Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to avoid all user prompts when running API in silent mode

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
MikeGillam5072
1451 Views, 2 Replies

How to avoid all user prompts when running API in silent mode

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

2 REPLIES 2
Message 2 of 3
YuhanZhang
in reply to: MikeGillam5072

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.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 3 of 3

Thank you.

 

I should have thought of that myself!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report