Revit Sharp Develop Macros FIle Open

Revit Sharp Develop Macros FIle Open

stever66
Advisor Advisor
1,765 Views
2 Replies
Message 1 of 3

Revit Sharp Develop Macros FIle Open

stever66
Advisor
Advisor

I've searched, and the Sharp Develop Macro Editor inside Revit doesn't appear to have a "File Open" option.

 

Is that really the case?

 

I believe that means the only way to copy a Macro from one computer to another would be to open the code in a text editor, and copy and paste the entire code.  It would also be the same to copy a Macro from one Revit file to another Revit file, or to copy a macro from an Application level to a project level.

 

Am I missing something?

 

Thanks:
Steve

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

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Steve,

 

I believe that you are right, in principle.

 

A project macro is stored in the project file, and you can copy it to another project using copy and paste of each code module via the SharpDevelop IDE.

 

The macro modules are actually also stored as files somewhere on the computer system, so you can hunt them down and copy the code from there as well.

 

You could also use the application-wide macros to transfer code.

 

They are also stored in external files somewhere, I think.

 

Personally, I prefer using the Visual Studio add-in and straight pure 'normal' add-ins.

 

I find the code easier to manage that way.

 

Macros have many other advantages, of course, e.g. no installation of Visual Studio, no compilation and installation step, immediate debugging without reloading the project etc.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

stever66
Advisor
Advisor

It looks like you are correct.   Application macros seem to be in the C:\ProgramData\Autodesk\Revit\Macros\2016\Revit\AppHookup folder.

 

Each module creates its own folder.  The entire folder can be copied from computer to computer, and the macros appear when revit is restarted.

 

The interesting thing is that Application level macros make a Visual Studio .sln file.   I'm wondering if this can be easily converted to a regular external command or application.  I'll have to install VS 2015 with python to find out.

 

I believe the document level macros are stored right in the revit project file, so there isn't any way to copy those without copying and pasting in the macro editor.

0 Likes