Message 1 of 4
Multiple running instances of Inventor and the API

Not applicable
06-02-2016
02:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Haha gulp I have been trying to figure out why a particular code didnt work as it happens it dose which made searching for an error very hard. The problem was that my code couldnt select a document because there were multiple instances of inventor open this understandable confusses the vb.net/ Inventor API. How canb I handle a situation where multiple instances of inventor are open?
The code that dose work as example bellow:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim invApp As Inventor.Application invApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application") Dim Doc As Document Doc = invApp.ActiveDocument ' Update or create the custom iProperty. UpdateCustomiProperty(Doc, "Test", "Some Text") End Sub