Revit 2025 - Can't edit macros

Revit 2025 - Can't edit macros

Michael_Coffey_G
Contributor Contributor
1,137 Views
12 Replies
Message 1 of 13

Revit 2025 - Can't edit macros

Michael_Coffey_G
Contributor
Contributor

At some point I lost the ability to edit macros in 2025.  I'm not sure if it was because of the Revit Preview Release, VS Code update, or a VS 2022 update.  But when I went in to edit a macro it warned that it didn't have the path to the .NET SDK 8.0.  I installed from the given link, rebooted but still didn't work.  I then uninstalled the SDK and VS Code and reinstalled. But still does not let me edit the macros.  I can open VS Code and edit the macros and build, but it requires a restart of Revit each time I make a change.  Any help appreciated.

Revit 2025 Macro problem.png

0 Likes
1,138 Views
12 Replies
Replies (12)
Message 2 of 13

sragan
Collaborator
Collaborator

Any chance you edited the code.cmd to use Visual Studio instead of VS Code?

 

And when you reinstalled VS Code, did you select the "add to path" option as suggested in the Revit Help?  (I'm not exactly sure what that does - it might just fill in the path you have shown in the "Configure Path" dialog.)

 

Otherwise I'm not really sure why the Edit button would be greyed out.   you obviously still have the macros enabled, because you said you can run them.

 

The only other thing I can think of is to open VS Code, and select the extensions, and make sure the following are installed (see attached):

.NET Install Tool

C# Base language support

C# Dev Kit 

 

I also have "Intellicode for C# dev kit" but that probably is not necessary to run or debug.

 

If you copy and paste the path to "code.cmd" into a windows explorer, it should look like the attached image.   Also, if I copy and paste the whole text in that path (...Appdata...code.cmd)  into the path in a Windows Explorer Box, it will open VS Code directly.  

0 Likes
Message 3 of 13

Michael_Coffey_G
Contributor
Contributor

Thanks for your reply.  I reinstalled VS Code to make sure that option was checked and it was on reinstall.  I had the 3 extensions and went ahead and installed the 4th.  I checked the code.cmd and it matches yours.  I also tried toggling application macro enabled off and on, rebooting Revit.  I moved my Test module out of the folder to see if it would let me create a new one.  But the three buttons still remain disabled.  Very infuriating!

0 Likes
Message 4 of 13

ricaun
Advisor
Advisor

VS Code for C# is not good, you could try Visual Studio 2022 if you have installed.

 

Just need to update the code.cmd, here is a video.

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes
Message 5 of 13

Michael_Coffey_G
Contributor
Contributor

I found that while trying to figure this out.  I set the code.cmd to the file I got from git.  But no change, the 3 buttons stayed disabled.  Thanks though.

0 Likes
Message 6 of 13

sragan
Collaborator
Collaborator

This is from an older note, but it does say it covers of Revit 2025:

 

https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Create-module-grey...

 

also, Rican has a video that shows how to use visual studio with the macros, instead of visual studio code.


https://forums.autodesk.com/t5/revit-api-forum/revit-2025-macro-manager-and-visual-studio-2022/m-p/1...

 

 

 

 

0 Likes
Message 7 of 13

Michael_Coffey_G
Contributor
Contributor

I tried using Rican's method, but it didn't make the 3 buttons enabled.  I also just cleared the C:\ProgramData\Autodesk\Revit\Macros\2025\Revit\AppHookup folder and reinstalled Revit 2025.  The buttons are still disabled.

0 Likes
Message 8 of 13

sragan
Collaborator
Collaborator

Did you try making sure the RevitAPI.dll has full permissions like the first link above?

 

If that doesn't fix it, I think you should contact Autodesk.

0 Likes
Message 9 of 13

Michael_Coffey_G
Contributor
Contributor

Yes.  For 'Users' I updated it.  Restarted Revit and no change.  Is it strange that it changed the modified date on the dll?

0 Likes
Message 10 of 13

ricaun
Advisor
Advisor

@Michael_Coffey_G wrote:

At some point I lost the ability to edit macros in 2025. I'm not sure if it was because of the Revit Preview Release, VS Code update, or a VS 2022 update.


Most probable is something wrong with your Revit 2025, I recently install Revit 2025 and was not a requirement to have VS Code installed, I just change the code.cmd and was able to create macros without any issue.

 

If you install Revit Preview Release in the same machine could be related, usually good idea to install Revit Preview in a visual machine.

 

I know the Macro install a template, and could be found in Visual Studio 2022. Maybe is not installed and Revit check for that.

ricaun_1-1734552362744.png

 

Maybe you need to reinstall Revit or something.

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes
Message 11 of 13

sragan
Collaborator
Collaborator

That sounds normal to me.  If you change the permissions, it should change the date on the file.

 

Did you install any other addins or external tools recently?  It seems like I remember something about some vendors disabling debugging so people couldn't hack their addins.  

 

I guess you could also try searching the journal files to see if that gives you any hints.


But otherwise, it sounds like you may have to contact Autodesk to get this resolved.

 

 

0 Likes
Message 12 of 13

Michael_Coffey_G
Contributor
Contributor

Thank you.  Something else that happened that I just remembered.  Back in September my company had me create a new Windows profile.  So maybe there are lingering permissions issues from that.  But if I reinstalled Revit, you would think that it would have been fixed.  I'm supposed to get a new computer next month, so hopefully everything new will resolve it.

0 Likes
Message 13 of 13

sragan
Collaborator
Collaborator

I now have a very similar problem.   I can still create new macro modules, and I can edit the modules and add new macros.

 

But nothing will allow me to run the new macros.  The "+" sign beside the module will not show up, and the new macros won't show up.

 

Minimum reproducible case:   

1.  Create a new Module.  VS Code opens with the module open.

2.  Create a new macro by un-commenting the 4 lines of sample code

   ie: 

public void SampleMacro()
{
   System.Diagnostics.Debug.WriteLine("Hello, World!");
}

  

3.  Right click the module csproj file in the solution explorer and pick "open in new terminal", and type "Dotnet build".

 

And what do you know  - I get something completely different than the last 12 times I tried this.  For no reason.   The last 12 times I tried typing "dotnet build", it was like it was printing the dotnet help.    Now I finally get a "succeeded message".   

 

Any idea why VS code didn't work the previous 12 times?  I've found I have to restart it a lot, but I did that several times over the last several days, and it was always the same - different message like I was typing "help build".

 

This VS code is absolute crap.  I think I might like it if it just worked, but it simply doesn't.

 

 

 

0 Likes