Setting up Rhino inside Revit

Hello there,

I tried to follow step by step instruction to use rhino in revit. (https://github.com/mcneel/rhino.inside/tree/master/Autodesk/Revit)

However, I got the following error message when typing “git clone --recursive https://github.com/mcneel/rhino.inside.git rhino.inside” in Git client

Error : " fatal: could not create work tree dir ‘rhino.inside’: Permission denied"

Does anyone know what I should do? Also, where I can find a download link to download the source code in the link above?

Thank you very much.

Hi,

Be careful with the local folder where you are trying to clone the repository, you should do the command in a directory where you have write permissions.

As an alternative, you can download the full repository source code in a ZIP file using the “Download ZIP” button you can see in the screenshot.

1 Like

Hello Kike,

Thanks for your reply. I managed to download the package and open rhino.inside\Autodesk\Revit\RhinoInside.Revit.sln

However, I encounter another problem while setting it up in the visual studio. The website says 2. Set the Solution Configuration drop-down according the Revit version you have installed. This will properly link the correct Revit API libraries to the project.

I’m using Revit 2018. I tried to change it in the dropdown menu, but it seems that it doesn’t detect autodesk api. Do you know where I can find the API reference?

Thanks.

The project is configured assuming you have Revit installed on the same device you are compiling.
By default, Revit 2018 use to be installed at C:\Program Files\Autodesk\Revit 2018

Thanks. I think that I’m close to make it work. I managed to open grasshopper through Revit, however, it gives me a warning message when I put a point in the grasshopper canvas and then it freezes forever.

Do you know if this problem relates to an error below? I set the project as startup project, but it still gives me the same error.

image

I wonder if I will need to set up something here or any other solution to make this work?

I guess you are running Revit from the normal Start Menu or Desktop icon.

If you debug it instead of just running it we can try to found what’s happening.

  • First thing Visual Studio needs to know is where your Revit.exe is located.
    You can do it here:

  • Then in the Visual Studio menu go to Debug > Start Debugging. Revit will start in debug mode.

  • Once in Revit, do again what is causing the problem, in this case inserting a point in the Grasshopper canvas.

  • When the message you shared above appears, press Retry, Visual Studio will pop up and you will be able to see the problem in context. Please do a screenshot of VisualStudio in this state and share it here.

Also, please try to stay updated, I mean download again the source code to test always the latest version. If both have the same source code it will be easier.

Hi Kike,

I somehow still got the following messages. Any other suggestion? Thanks.

The message says “Object reference not set to an instance of an object” in line 258.

This line is like this:

if (dBView.CropBoxActive && !Rhino.Geometry.BoundingBox.Intersection(CropBox, primitive.ClippingBox).IsValid)
        continue;

Could you please test if primitive is null in your case?

I don’t have Revit 2018. I tested it in Revit 2017 and 2019 and runs in my case

Still couldnt make it work with Revit 2018, but it works just fine in Revit 2019. Thanks for your help!

I keep getting a list of errors similar to this when trying to build the project

Error occurred while restoring NuGet packages: ‘$(RevitVersion).*’ is not a valid version string.
1>------ Build started: Project: RhinoInside.Revit, Configuration: Release 2019 Any CPU ------
1>C:\Program Files\Autodesk\Revit 2019\GH\Element\BrepElement\ByGeometry.cs(9,7,9,18): error CS0246: The type or namespace name ‘Grasshopper’ could not be found (are you missing a using directive or an assembly reference?)
1>C:\Program Files\Autodesk\Revit 2019\GH\Element\BrepElement\ByGeometry.cs(10,7,10,18): error CS0246: The type or namespace name ‘Grasshopper’ could not be found (are you missing a using directive or an assembly reference?)
1>C:\Program Files\Autodesk\Revit 2019\GH\Element\BrepElement\ByGeometry.cs(12,7,12,15): error CS0246: The type or namespace name ‘Autodesk’ could not be found (are you missing a using directive or an assembly reference?)
1>C:\Program Files\Autodesk\Revit 2019\GH\Element\BrepElement\ByGeometry.cs(13,7,13,18): error CS0246: The type or namespace name ‘Grasshopper’ could not be found (are you missing a using directive or an assembly reference?)
1>C:\Program Files\Autodesk\Revit 2019\GH\ID.cs(7,7,7,12): error CS0246: The type or namespace name ‘GH_IO’ could not be found (are you missing a using directive or an assembly reference?)

what am I doing wrong?

1 Like

The first thing to check is your Visual Studio version.
We are using what Microsoft calls Floating Versions to reference NuGet packages.
This allows us to specify just major version and accept any minor version in for some project Package References.
What Visual Studio version are you using?
I think this is supported since version 15.7 of Visual Studio.

A second thing to check is your project configuration names.
$(RevitVersion) is defined as 2017, 2018 or 2019 depending on your project configuration name.

Have you changed the configuration Name in your project?

Hi,

There was a bug.
Grasshopper preview bounding boxes were computed too late when Revit Views are cropped.
It’s fixed, if you update your repository copy you should stop observing this on any Revit version.

1 Like

Is there a step-by-step tutorial on how to update the repository copy?

You should open a command line, go to your repo folder and run this there.

git pull

1 Like

Once that’s complete, I assume I will rebuild the 2019 solution in Visual Studio before relaunching Revit? Thanks for answering my noob questions!

Right,

The installer is coming.

1 Like

What could be wrong here? Trying to install and open Revit 2019.

Finally, we have an installer here.

I hope you enjoy.

2 Likes