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.
Solved! Go to Solution.
Solved by ekinsb. Go to 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.