Inventor Customization

Inventor Customization

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

save menu question - add-in??

201 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: 480
Registered: ‎01-06-2009
Message 2 of 4 (177 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 (170 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: 480
Registered: ‎01-06-2009
Message 4 of 4 (163 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
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.