Here's my problem:
I'm an intern at a company that uses Inventor 2011. One of my primary jobs is to update assemblies, presentations, and the corresponding prints. When updating the prints I need to update the drawing resources to reflect the newest print template. To do this I copy the Drawing Resources from the apporoved print and paste them into the Drawing Resources for the print I want changed. When I do this I need to click "Replace" then either click "OK" or hit enter. The problem is I need to do this 30-ish times for each print. I can't use the drawing resource manager because all the prints are cloud based on a central server located away from our facility, so I don't have complete access to all the prints.
What I want:
I want a way to either write a program that would make those clicks for me (the window that pops up is the active window) or make a button that has the clicks and memorized so it will do it for me. I hope this is possible, because doing this manually is a pain.
Thanks for any help!
This is fantastic, but unfortunately it wants to create a new document when I update. I am using the manual update and when I push 'cancel' on the document creation I get an error.
I posted this on your mcad forum, but since you replied so quickly to this I figured I'd try it out here as well.
Once again thanks for all your hard work
First of all, did you try setting the Application.SilentOperation = true? This should let Inventor go with the default choice silently for each dialog being displayed. It might be a simple solution if it works.
Concerning your questions, the first one could be achieved but it will require a bit of programming skills, especially that it will involve relying on Win32 API: to get this done you may need two main things, the first is using a CBT Hook in order to hook into the dialog display mechnism. You can easily find .Net implementations of CBT Hooks over the web, the second would be to iterate through the controls displayed in that dialog and programmatically send a mouse click message to the OK button. Again finding how to do that can be easily found on the web, take a look at www.pinvoke.net/ if you are not familliar with it.
The second question "make a button that has the clicks and memorized" is not really doable if you don't deal with your custom controls.
Developer Technical Services
Autodesk Developer Network