Skip to content

Getting started for developers

Al Fisher edited this page Apr 17, 2020 · 34 revisions

Welcome Developers! 🚀

Here's a quick start guide. After reading this, you might want to head to the Introduction to BHoM_Adapter, and then create your own Toolkit.

Building BHoM from Source

Please follow the steps below:

  1. Use git clone (or use GitHub desktop) to download the repositories in the list below.
  2. Use your preferred IDE to build the solutions in the order as they appear below. We recommend Visual Studio Community.

🚩 Note: Build order 🚩

Choose, clone and build the repos in the order specified below.

Once you have built everything you need, you must re-build BHoM_UI. This is because BHoM_UI triggers a process that distributes all compiled dlls in the right UI folders.

This means that every time you change your code and recompile a Toolkit, you have to recompile also BHoM_UI for the changes to appear in your UI of choice (be it Rhino, Dynamo, others).

Mandatory base repos 🔴

Main repos

Compile each of these, one after the other:

User interface(s)

Compile one or more of the following - depending on the User interface software you want to use:

  1. Rhinoceros_Toolkit and then Grasshopper_Toolkit (requires Rhinoceros_Toolkit)
  2. Excel_Toolkit
  3. Dynamo_Toolkit

REMEMBER: after all this, whenever you do a change to any Toolkit, you must re-build BHoM_UI. See 🚩the note above 🚩.

The following repos are optional.

Optional base repos 🔵

These repos are sometimes used as stand-alone, and sometimes are also referenced by other repos.

You might find them useful 🚀

  • BHoM_Datasets - makes Datasets available (some test scripts might be using them)
  • Socket_Toolkit - send messages through Sockets. Some toolkits use this.
  • Mongo_Toolkit - database connection. Some toolkits use this.
  • Versioning_Toolkit - allows retro-compatibility of components (auto upgrade to newest version).

Toolkits 🌍

Toolkits provide the connection to other software.

Clone and build any toolkit you want to use!

Some examples:

REMEMBER: after all this, whenever you do a change to any Toolkit, you must re-build BHoM_UI. See 🚩the note above 🚩.

🔰 Pro tip - debugging and rebuild🔰

When developing a Toolkit, in order to reduce rebuild iterations, you might want to:

  1. Rebuild your Toolkit
  2. Rebuild BHoM_UI
  3. Start Debugging your Toolkit with an UI application attached.

The last step will fire up your UI application and you will be able to modify the code while debugging, on-the-fly (just press the Pause button in Visual Studio).

Note that not all IDEs support this (notably, not the Express editions of Visual Studio – only the Community, Professional and Enterprise ones do).

An alternative that always works is, after steps 1 and 2 above, simply fire up your UI application and attach to its process. This way you will be able to follow code execution and check exceptions; however, this does not allow for code modification while debugging.

FAQ - common issues

My Toolkit/latest changes do not appear in Grasshopper/Dynamo/Excel/etc!

Have you 🚩recompiled BHoM_UI 🚩 ?

I can't Rebuild the solution: NuGet package(s) missing error

Sometimes you might encounter this error. Although Visual Studio "Rebuild All" command should take care of Restoring the NuGet packages for you, to solve this just run that manually.

Right click the solution → Restore NuGet Packages.

Clone this wiki locally