In this section, we’ll discuss how to begin your contribution to Dynamo for Revit by ‘forking the repo’.
The very first thing we need to do is to fork the Dynamo repository. If you're not sure what this means, it’s essentially when you make your own personal copy of someone else's repository.
Forks are used to either propose changes to someone else's project or to use someone else's project as a starting point for your own idea.
Source: Github
To fork the Dynamo repo, head over to Dyanmo’s Github and open the DynamoRevit repo. Here, you'll notice the ’fork’ button (and icon) at the top of the screen.
Press it and you’ll see a dialog box that looks something like the image below. Select the Github account you want to fork the DynamoRevit repo to.
You should now have a copy of the DynamoRevit repo in your own Github account - this is your repo and you can add changes to it without worrying about messing anything up. Go ahead and clone this repo to your local machine.
Your repo will contain a series of files and folders. There should also be a solution file called ‘DynamoRevit.All.sln’ - this is important because this is where you add and edit code.
For most projects, all you need to worry about is the ‘Libraries’ and ‘Tests’ folders. In the ‘Libraries’ folder, you’ll see two projects, one called ‘RevitNodes’ and another called ‘RevitNodesUI’. These projects are where all the DynamoRevit nodes live and it's where you add your own code as well.
The final step before we can start writing code is making sure that we have all the dependencies we need for building a solution.
To do this, head to a folder called ‘src’ in the DynamoRevit repo. Here, you'll see a file called ‘restorepackages.bat’ - this is the file we use to house all solution dependencies. There are a few different ways of running this file - I usually run it directly from Visual Studio as I find it easier.
To run the file, go to the ‘Package Manager Console’in Visual Studio and type in the following path: ‘.\restorepackages.bat’
You’re now ready to start writing code in the DynamoRevit solution! In Part 3, we'll explore how to test your code.