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: 

VBA Skip warning when saving

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
pball
2155 Views, 9 Replies

VBA Skip warning when saving

I have a mass print script and I have it save then close the drawing after it's done printing each one. The problem is the script updates the mass properties and some times drawings just update when opened. So when it saves different "warnings" can pop up, which pause the script until the pop up is taken care of. The warnings are typically for saving other files like the ipt linked to a drawing or if the drawing was saved in an old version. Is there a way to just accept those while running a script so it does puase?

 

How I save and then close the drawing.

 

ThisApplication.ActiveEditDocument.Save
ThisApplication.ActiveEditDocument.Close True

9 REPLIES 9
Message 2 of 10
YuhanZhang
in reply to: pball

SilentOperation can suppress Inventor warnings, maybe you want to use this.



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 10
pball
in reply to: YuhanZhang

Thanks. I played with this some and it seems to doing just what I need.

Message 4 of 10
akosi
in reply to: pball

hi,

would you mind sharing your code.

i have the same problem.

can i do it in vb within inventor?

 

 

thanks

inventor 2011

vault 2012

Message 5 of 10
jdkriek
in reply to: akosi


@akosi wrote:

would you mind sharing your code.

i have the same problem.

can i do it in vb within inventor?


 

ThisApplication.SilentOperation = True

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 6 of 10
pball
in reply to: jdkriek

And one word of warning. Make sure to set it to False by the time the script finishes. I have some exit subs in the script I did and the setting stayed on after the script was done, if it was exited via the exit sub. So I found an event that fired when the script was done, whether it exited or completed and put set it back to false there.  Depending on what your script is like, you could just ignore what i've said.

 

Private Sub UserForm_Terminate()
    ThisApplication.SilentOperation = False
End Sub

Message 7 of 10
jdkriek
in reply to: pball

Good point, always set back to False 😉

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 8 of 10
akosi
in reply to: akosi

where can i do this code , inside inventor?

Message 9 of 10
jdkriek
in reply to: akosi

Yes, you can use this in iLogic

 

ThisApplication.SilentOperation = True

 

You won't need the VBA script posted by pball for your situation.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 10 of 10
mrattray
in reply to: jdkriek

You can set this as a tick box option in the iLogic rule editor as well.

 

Capture.JPG

Mike (not Matt) Rattray

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

Post to forums  

Autodesk Design & Make Report