Load independent add-ins in more than one session of Autodesk Inventor

Load independent add-ins in more than one session of Autodesk Inventor

KOKAK
Enthusiast Enthusiast
1,433 Views
30 Replies
Message 1 of 31

Load independent add-ins in more than one session of Autodesk Inventor

KOKAK
Enthusiast
Enthusiast

When I charge a second or third Inventor session to work with more than one project at a time, the Add-ins programmed by me and loaded in these new sessions, always work on the first session of Inventor.

What must be done so that the Add-ins of each Inventor session are independent and work each one with their corresponding Inventor session.

0 Likes
1,434 Views
30 Replies
Replies (30)
Message 21 of 31

bradeneuropeArthur
Mentor
Mentor

are you using this method:

 Public ReadOnly Property InventorApplication As Inventor.Application
            Get
                Return m_inventorApplication
            End Get
        End Property

        Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate

            ' This method is called by Inventor when it loads the AddIn.
            ' The AddInSiteObject provides access to the Inventor Application object.
            ' The FirstTime flag indicates if the AddIn is loaded for the first time.

            ' Initialize AddIn members.
            m_inventorApplication = addInSiteObject.Application

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 22 of 31

KOKAK
Enthusiast
Enthusiast

 

 

 

This part does not:

Public ReadOnly Property InventorApplication As Inventor.Application Get Return m_inventorApplication End Get End Property

Esta parte no

0 Likes
Message 23 of 31

KOKAK
Enthusiast
Enthusiast

My conclusion is that my add-ons are loaded in memory and are linked in some way to the first Inventor session even if they are invoked from other subsequent sessions.

0 Likes
Message 24 of 31

bradeneuropeArthur
Mentor
Mentor

you should implement the missing lines..

 

Please upload your complete add in file.

Don't hesitate because you can leave all sub modules out for privacy reasons.

 

You also can send it by a private message!

 

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 25 of 31

KOKAK
Enthusiast
Enthusiast

Yes, these lines of code exist, but in this way:

 

Public ReadOnly Property Automation() As Object Implements Inventor.ApplicationAddInServer.Automation
            Get
                Return Nothing
            End Get
        End Property

 

I'm cleaning one of Addins of unnecessary code to upload it

0 Likes
Message 26 of 31

w.pepping
Advocate
Advocate

Hello,

I had the same problem in the past. Your add-in needs to know which Inventor session has start it up.

In the StandardAddInServer check if you have this:

 

Public Module Globals
    ' Inventor application object.
    Public g_inventorApplication As Inventor.Application

In the 'Activate'  section you start with:

 

 

        Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
            ' Initialize AddIn members.
            g_inventorApplication = addInSiteObject.Application

Then if you have a button for startup your program send the 'g_inventorApplication' in your arguments to start the form.

Dim Arguments() As Object = {CType(g_inventorApplication, Object)}

Now you can work in multiple Inventor sessions with the same add in.

 

 

Get control of your sheet metal files.
Download the app from matprop.com
Message 27 of 31

bradeneuropeArthur
Mentor
Mentor

That is what I tried also to explain, but with no succes.
You did it in more detail, think that it must be solved with this last comment of you.

Regards

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 28 of 31

KOKAK
Enthusiast
Enthusiast

Partially obtained

I have achieved this in the functions Sub and Function without form, passing them the argument g_inventorApplication.

However, I can not pass the argument to the forms.

My programs are done with VB.net

Thank you very much.

0 Likes
Message 29 of 31

KOKAK
Enthusiast
Enthusiast

Could you tell me how to pass the parameter to the forms?

Thank you very much.

0 Likes
Message 30 of 31

bradeneuropeArthur
Mentor
Mentor
you need to declare the application in the form like

dim y as new Form1
y.show(g_inventorApplication)

class Form1
new(X as inventor.application)
end Class

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 31 of 31

KOKAK
Enthusiast
Enthusiast

Finally it has worked for me in this way:

 

dim y as new Form1(g_inventorApplication)
y.show

class Form1
new(X as inventor.application)
end Class

 

Again thank you very much everyone. You have been really helpful.

And forgive my bad English again.

 

 

0 Likes