Message 1 of 1
Display name of subcomponents with Inventor View 2021

Not applicable
04-19-2021
06:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning,
i need to create a Windows Form .exe to retrieve the display name of the subcomponents of the active assembly opened with the Inventor View 2021 application.
I've already created other add-in related to the Inventor Professional 2021 but, with the inventor view, i cannot use, for example, the ActiveDocument object to access the document properties (an exception rise up because the object is null).
In my visual studio 2019 application i've referenced the autodesk.inventor.interop.dll and the Interop.InventorApprentice.dll but it's not working.
How can i connect my .exe form to the inventor view 2021 application?
Here my code:
Imports Inventor
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim invApplication As Application = GetObject(, "Inventor.Application")
Dim doc As Document
doc = invApplication.ActiveDocument
MessageBox.Show(doc.DisplayName)
End Sub
End Class
Thank for your help!