Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
davidm
337 Views, 2 Replies

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

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.

2 REPLIES 2
Message 2 of 3
ekinsb
in reply to: davidm

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
Message 3 of 3
davidm
in reply to: ekinsb

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report