Inventor Customization

Reply
Valued Contributor
SMachado
Posts: 98
Registered: ‎11-19-2009
Message 1 of 4 (199 Views)

save menu question - add-in??

199 Views, 3 Replies
03-28-2011 08:17 AM

HI everyone!

 

When i aply the following save code:

 

- oapp.Documents.Item(i).Save()

 

If i have a assembly document opened when this code runs, is there any possiblity to answer the save menu questions( please see menu i'm talking about in the attached file). with code?

 

i mean save the assembly document and all it's dependent's without showing the save menu.

 

thanks.

 

 

 

 

Employee
yuhanzhang
Posts: 474
Registered: ‎01-06-2009
Message 2 of 4 (175 Views)

Re: save menu question - add-in??

03-31-2011 07:25 PM in reply to: SMachado

You can use the SilentOperation to suppress Inventor dialogs.



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Valued Contributor
SMachado
Posts: 98
Registered: ‎11-19-2009
Message 3 of 4 (168 Views)

Re: save menu question - add-in??

04-01-2011 09:00 AM in reply to: yuhanzhang

Hi!

 

I never heard about this SilentOperation what so you mean by SilentOperation? can you give me a sample code on how to apply this?

 

I have applyed the save2 in my code, but sometimes this save2 doesn't work, for example when i'm editing a assembly.

Employee
yuhanzhang
Posts: 474
Registered: ‎01-06-2009
Message 4 of 4 (161 Views)

Re: save menu question - add-in??

04-01-2011 11:44 PM in reply to: SMachado

The SilentOperation can suppress the dialog with default setting only, the Save2 can let you set the dependent documents to save, and no save dialog will pop up. But what you mean the Save2 won't work if there is an in place editing, I think this is as designed for now, but you can exit the in-place edit document, you can compare the ActiveEditDocument with the top assembly to know if you need to call the ComponentOccurrence.ExitEdit(kExitToTop) before calling Save2.

 

Hope this helps.



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.