How can you pass a variable from one addin to another using vb.net

How can you pass a variable from one addin to another using vb.net

Anonymous
Not applicable
475 Views
2 Replies
Message 1 of 3

How can you pass a variable from one addin to another using vb.net

Anonymous
Not applicable

I've used vb.net to write two separate addins.  I was wondering if there is a way to pass a variable from one addin to another similar to the way shared variables are passed from rule to rule in iLogic.

0 Likes
Accepted solutions (1)
476 Views
2 Replies
Replies (2)
Message 2 of 3

ekinsb
Alumni
Alumni
Accepted solution

It's not as simple as a shared variable but the two add-ins are distinct programs and don't share anything.  However there are potentially a couple of solutions for passing information between two add-ins.

 

The first is for one add-in to write information into a location that the second add-in has access to.  For example, you could create an iProperty on a document or create an attribute.  The problem with this approach is all of the locations where you can write custom data are in documents so the second add-in would have to know which document to look in and you would be dirtying the document which could be confusing to the user.

 

The second approach is that an add-in can support it's own custom API.  For example, one of your add-ins could support a public method called SetValue and the other add-in can find the first add-in and call this method, passing it the value.

 

A third approach I just thought of is to write the information to a file on disk.  This is similar to the first solution but has the advantage that it's not editing anything in Inventor.  It would also be simpler to implement.

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you for replying to my question ekinsb.



I used your third solution by saving the information to a text file. It
works perfectly. I just need to make sure permissions are available in all
addins, which is handled by my installer(s).



I couldn't use a public method because there can potentially be several
addins that need to communicate, but I won't know which ones are installed
on the user's computer.



Thanks again for your help.



My question has been answered.
0 Likes