Message 1 of 6
Beginning Inventor API Programming
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've spent the last several years developing .NET programs which allow a user with no experience at all with AutoCAD to get drawings and BOMs by using a web interface. I've now taken on a similar task but this time I'll be using Inventor instead of AutoCAD and after my first day into the plan I can report these findings:
- I was surprised to find that almost all the tutorials and examples for using the Inventor API use VB, not my languages of choice C# and Python.
- The tutorials available are usually old and outdated. I think most of you will agree that there seems to be a conspiracy among AutoDesk developers to change up everything from one release to the next. What worked in 2015, no longer works for 2017.
- The work I'm interested in will be where the Inventor software will never be visible to the users. In fact, it will be running on a machine that will probably not even be in the same building with them. Their requests will be formatted and the drawings and BOMs will be prepared and stored for them to access either by email or a link to another server, in PDF format. Remember, the users I'm targeting have no idea how to use Inventor or even that Inventor is driving the process.
- The tutorials I've studied thus far rely heavily on user input, or a file already existing is to be modified in some manner. Again, the target for this platform are people with no experience or desire to learn Inventor or any other software. They will simply be clicking on options in their web browser. The ability to produce accurate and speedy documents while being as hands-free as possible is the main goal.
Okay, that said, I'm looking first to have my C# code check if an instance of Inventor is running and if so use it. If not, open one and use it. Thus far all I've found is code which will report to the user if an instance is found or not. Again, this project will not be interested in reporting anything to the users except that their drawing/BOM is complete.
Here is the very simple start of my project:
try { Inventor.Application objApp = null; objApp = (Inventor.Application)
System.Runtime.InteropServices.Marshal.GetActiveObject
("Inventor.Application"); } catch { // This is where I need to start Inventor running if an instance is not found }