Create Ribbon and button with macro

Create Ribbon and button with macro

GeorgK
Advisor Advisor
826 Views
1 Reply
Message 1 of 2

Create Ribbon and button with macro

GeorgK
Advisor
Advisor

Hello together,

 

I am very new to Revit. Is it possible to create a ribbon and a button with a macro?

 

Thank you very much

Georg

0 Likes
827 Views
1 Reply
Reply (1)
Message 2 of 2

stever66
Advisor
Advisor

I believe the Revit API says its not supported for the macros, however, I think it is possible.  Macros have  Module_Startup and Module_Shutdown segments that run when revit opens and closes.


The last time I tried adding a ribbon button with a macro, it ran correctly the first time, but caused an error message after it ran again.  But maybe I wasn't unloading it correctly on the shutdown.

 

You may need to use Joshua Lumley's "5 secrets of Revit API Coding" to get it to work, and it's not real basic:

 

https://thebuildingcoder.typepad.com/blog/2018/09/five-secrets-of-revit-api-coding.html#3