Run a.dyn from a Revit add-in?


This code doesn’t work for me, if start of this before using Dynamo in current session of Revit. According messages, Revit can’t resolve references. I tried to put this to both paths: C:\Program Files\Dynamo\Dynamo Core\2, and C:\Program Files\Dynamo\Dynamo Revit\2\Revit_2019, and copy all files from these both paths to third path. If start Dynomo at lease one time and close, the code works. Is possible using the code without starting Dynamo?


Hey can you share .sln file for visual studio. ( or anyone other who did it)
Im not able to debug and build solution. I guess I’m taking wrong template file. :pensive:

got this error. How to resolve ?

@Nissal you do not have the using statements for the required references, refer to the first few lines in this post(Run a.dyn from a Revit add-in?)

1 Like

this error is because you are not referencing any revitapi.dll / revituiapi.dll

1 Like

@Brendan_Cassidy Thank you :smiling_face_with_three_hearts: for that I forgot to read above lines.

@stillgotme I have added both the references.
Stuck with Transaction and Regeneration command. Is this because of revitapi.dll / revituiapi.dll ?

@Nissal Add the following to the top above “using Autodesk.Revit.DB”

using Autodesk.Revit.Attributes;

1 Like

yea do what @Brendan_Cassidy said, but with that being said. You can right click the red underlined error and see if there is possible solutions that VS can solve for you automatically.

1 Like

@Brendan_Cassidy @stillgotme Thank you again :slight_smile:
I done a clean solution and then build solution. Got this error -

CS0115 'Service1.Dispose(bool)': no suitable method found to override

I had googled for this error. one of them said to match namespace with project name ( which is correct in my case) and another said to change CPU platform from configuration manager. I tried both x64 and x86.

I got 2 warnings in x86. So kept CPU platform on x64.

@Nissal You need to review your other .cs file(Service1.cs) because it is probably something within that file.

yes, to tell you the exact error from your code, there is an override method (something like this public override void Dispose())in your service1.cs that is causing this error. Most likely is your reference to class (something like this public class app : IExternalApplication) from that class is broken.

Hi everyone ,
I am trying to work on something similar, but I keep get this error:
CS1503 C# Argument 1: cannot convert from to
Where is the problem ?

Look at line 113, you have a comma instead of a dot.

Have you looked at orkestra?

You can add any dyn to your ribbon


or pyrevit extensions :slight_smile:

you are a Hero. Thank you for the solution @klawson !!!

1 Like