Is there anyway to pass a variable from a Revit macro to an add-in.
Basically I have a "document opened" event handler in my add-in transaction which I want to pick up a user determined "keyword" variable.
The only way I can think of allowing this is for the user to edit the "keyword" in the macro code. Then the add-in picks this up when a document is "opened".
But I think the add-in transaction is blocking access to the external variable. Emphasis on the think here.
Any ideas would be much appreciated.
Solved! Go to Solution.
Solved by arnostlobel. Go to Solution.
Hello AncientOne,
I am afraid you'll need to elaborate a little more on your case, for the description you've provided so far is a bit cloudy to me. First of all, there is not "Document Opened" event in a "Transaction," at least as far as Revit "Transaction" goes. Also, Revit Transactions do not have anything to do with any "variables" in users' applications; therefore there is no "blocking" of access to variables.
As for "sharing" of variables between your external application and macros, I am afraid there is no direct sharing, for macros are executed in a different assembly. However, there is plenty of ways of sharing available in the Windows API (and .NET). For example, you could use a memory mapped files. However, such techniques go way beyond typical Revit programming.
Cheers