Building Dynamo from source in Visual Studio


#1

I am attempting to compile Dynamo for Revit from source but running into a number of issues. Firstly I am getting a resgen.exe issue when compiling. The key on my registry is not found which should be pointing to this file. If I manually change the key, it still fails which prevents the build from completing.

Secondly, I have found the post below but its old and there is a comment that it might not be possible to build Dynamo from source. While the thread proved it was possible, I am not sure if this is true for newer versions. Can someone confirm?

Also @Zach_Kron added a link to the Dynamo GitHub with instructions for building Dynamo from source, but the page is blank? Is there another resource elsewhere?

Here’s the post:
http://dynamobim.org/forums/topic/what-i-else-does-it-need-to-complie-the-dynamo-source-code/


#2

Hi @Thomas_Mahon - Did you follow the instructions in the readme: https://github.com/DynamoDS/DynamoRevit? These are the latest instructions.

I recently built D4R last week with these instructions. A few things to remember:

  • In order to run Dynamo for Revit, you must build Dynamo Core first
  • Make sure that you have the correct branches.
    ** The Dynamo Core and Dynamo for Revit branches must match. If you grab master from Dynamo Core, you need to grab the latest branch (Revit2016, Revit2017, or Revit2018; not one of the release candidate versions) from Dynamo4Revit

#3

I posted instructions here a while ago.


#4

Great post @Konrad_K_Sobon… and so true.

Everyone who has been working with Autodesk has tics in their eyes… The development of Revit seemed to have stopped since Autodesk acquired it. Dynamo has been its salvation from being changed to another AEC tool.
I can only back up the open source approach and invite all of us users inside… even if we are not hardcode coders!


#5

Hi @Racel_Williams

Thanks for the steps. The problem I’m getting which is preventing the build is as shown below. I’ve checked my registry and the key doesn’t exist, however I have the latest Windows SDK installed. I’ve added the key to the registry manually but it still isn’t found. Can you suggest a solution?

Also, there are 3 solution files in the Dynamo root master as shown below. The Dynamo_All outputs only assemblies and not an exe. Which one outputs the exe? Where are instructions which explain what the solutions files are and if they need to be built in a particular order?

With the Revit root master I am opening the DynamoRevit.2013.sln yet it too only outputs assemblies and no exe? Firstly, is this the correct solution to build from and as with the core, is there any particular order the solutions have to be built? Are there any resources which document Dynamo for Revit source with information explaining the different solution files and steps for interacting with and building it?

My ambition is to create a Dynamo for Revit installer from source in case you’re wondering.


#6

Thanks @Konrad_K_Sobon I’ll see if your article answers any of my questions above


#7

Pinging @Michael_Kirschner2 about your registry issue…

@Thomas_Mahon - Yes, “DynamoRevit.2013.sln” is correct solution to build from. D4R does not produce an exe. Follow the instructions on the DynamoRevit readme about creating a addin.

Essentially, you have 2 options for building:

  1. Build Dynamo Core first, then D4R.
  2. If you are building from master of Revit, you can run restorepackages.bat with admin privileges. You will not need to build Dynamo Core.

Regarding the addin, you can:

  • If you built Dynamo Core, run “DynamoAddInGenerator.exe” from the bin folder that gets generated.
  • Or you can make your own addin and place it in a location that Revit looks for addins (more instructions on the wiki)

Attached is an example of the addin.

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<RevitAddIns>
<AddIn Type="Application">
<Name>Dynamo For Revit</Name>
<Assembly>"C:\Program Files\Dynamo\Dynamo Revit\1.3\Revit_2017\DynamoRevitVersionSelector.dll"</Assembly>
<AddInId>8D83C886-B739-4ACD-A9DB-1BC78F315B2B</AddInId>
<FullClassName>Dynamo.Applications.VersionLoader</FullClassName>
<VendorId>ADSK</VendorId>
<VendorDescription>Dynamo</VendorDescription>
</AddIn>
</RevitAddIns>

#8

Thanks @Racel_Williams thats very useful info


#9

This is great…but shouldn’t that be somewhere on GitHub / Wiki? I hope it is. :slight_smile:


#10

@Konrad_K_Sobon @Thomas_Mahon - Most of what I said is in the read.me of the DynamoRevit repo.

A few things about the addin generator are not. That might be good to mention there.

If it is unclear, we can update the instructions. Just let me know how you think it can be improved.


#11

Hi @Thomas_Mahon

You will need the following to build Dynamo from source:

-Microsoft Visual Studio 2015
-GitHub for Windows
-Microsoft .NET Framework 4.5.
-Microsoft DirectX (install from %GitHub%\Dynamo\tools\install\Extra\DirectX\DXSETUP.exe)

Here is how you can install it.

Go to https://github.com/DynamoDS/Dynamo and clone the repo,
do the same with https://github.com/DynamoDS/DynamoRevit

  • Download Dynamo master and DynamoRevit 2017 to the same forlder with github desktop.

  • From GitHub Desktop open Dynamo and open the DynamoAll solution in Visual Studio

  • After Dynamo Core is build Run restorepackages.bat inside DynamoRevit.

  • Bulid DynamoRevit 2017

  • Add .addin file to %appdata%\Autodesk\Revit\Addins\2017\ with path: “[Your GitHub Folder]\Dynamo\bin\AnyCPU\Debug\Revit_2017\DynamoRevitVersionSelector.dll”

Hope it helps!


Trying to debug Dynamo Core - I have no Dynamo.config file
Compiling Dynamo src on Github
#12

@Thomas_Mahon, @Kulkul 's description is an accurate one. It’s worth mentioning that you are possibly getting the regex error because of Visual Studio 2017. Please download 2015 and it should work just fine. Also, you have to run it in Admin mode since it will attempt to make some changes requiring admin rights.


#13

@Racel_Williams somehow I couldn’t build the Revit2017 branch without first building Revit2018. I am not sure that’s desired behavior but it seems that some of the assemblies now have dependencies on 2018. Can someone check that out?


#14

Thanks @Kulkul and @Konrad_K_Sobon, I’ll follow your steps and see if that resolves the regex issue.


#15

@Konrad_K_Sobon - I just built Revit2017 without having to build Revit2018 first. What errors/warnings are you seeing? And, what step are you having issues with?

We made a few modifications to our build process, but you should be able to build Revit2017 without Revit2018.

(Tip: You might want to try running VS in Admin mode)


#16

always :stuck_out_tongue:


#17

Hey @Thomas_Mahon - I came across the exact issues as you did, but trying to build DynamoCore the other day.
It should be as simple as cloning the repo and clearly documented steps…this clearly isn’t the case.

To get Dynamo (Core at least) to build on Windows 10 and Visual Studio Community 2017, aside from the pre-requisites listed by @Kulkul, you also have to install the .NET 3.5 SDK add-on, search for “Visual Studio Installer” on your PC (comes with VS2017) and then add it from the “Individual components”.
As @Konrad_K_Sobon mentioned, installing Visual Studio 2015 is a good idea, seemed to have resolved some of the issues I was facing in VS2017 as well.


#18

Hi @Radu_Gidei thanks for the info! I’ll post my findings on this thread once I compile :+1: