Rhino/Grasshopper integration

About

Rhinoceros3D is a 3D modeler developed by Robert McNeel & Associates of Seattle, Washington USA. Rhino is used to create, edit, analyze, document, render, animate and translate NURBS (curves, surfaces, solids, point clouds and polygon meshes).

Grasshopper is a visual programming language environment that runs within the Rhinoceros 3D computer-aided design application. It is tightly integrated with Rhino's 3D modeling tools.

Installing Rhino/Grasshopper connection

  1. Download Rhino from https://www.rhino3d.com/download.
    Note: Users can use the Rhino/Grasshopper Connection within BricsCAD® with trial license keys of both current version of BricsCAD® BIM and Rhino 7. Since the release of BricsCAD® V21, keys for older versions of Rhino will not work for this integration.
  2. Download the Grasshopper-BricsCAD® Connection from the BricsCAD Application Store: https://boa.bricsys.com/applications/a/?rhino/grasshopper-connection-for-bricscad-bim-a1353-al2360. The installer copies all required files to the Program Files\Bricsys\Grasshopper-BricsCAD Connection folder.
    Note: The Grasshopper-BricsCAD Connection currently available from the Application Store will work in the current BricsCAD Pro, BIM, Mechanical or Ultimate versions.
    Note: The Grasshopper-BricsCAD connection works with Pro, Mechanical, BIM and Ultimate for creating geometry. However, the BIM specific functionality (adding classification, spatial locations, profiles, properties, IFC export) will only work with a BricsCAD BIM or a Ultimate license.
  3. Restart BricsCAD®.
  4. To launch Grasshopper or Rhino, open and save a new drawing. Then use the buttons in the new tab that is displayed in the ribbon or launch with the Quad.

To launch a Grasshopper file from BricsCAD®

  1. Open an empty BricsCAD® file.
  2. Save it.
  3. Open Grasshopper with the button in the new Grasshopper tab inside BricsCAD.
  4. You can close the Rhino pop-up window. Rhino will continue to work in the background.
  5. In the File tab of Grasshopper, choose New document to open a new and empty Grasshopper script.
  6. Choose Open document... to open an existing Grasshopper script. You can use any script you made with Grasshopper in the past and open it in BricsCAD®, as long as the input geometry from another program has been internalized. (To internalize data right-click the input geometry component and hit Internalise data.)
  7. The geometry you created with the script should now pop-up in your BricsCAD® model space, displayed in red. Make sure you don't close the Grasshopper window, otherwise the preview geometry will disappear, as the Grasshopper document is closed.
  8. If your Grasshopper script is open and you still don't see the preview geometry, it probably means your Grasshopper file is linked to the wrong BricsCAD® document. To link it to the correct one, see To link a Grasshopper file with a BricsCAD file.

To link a Grasshopper file with a BricsCAD file

By default, the BricsCAD® file that the Grasshopper document will link to the one that was active when you launched Grasshopper from BricsCAD®. If you want to link it to another BricsCAD® file, you need to:

  1. Make the target BricsCAD® drawing the current drawing (i.e. the one you see in the model space window of your current session).
  2. Link the Grasshopper script to this open drawing. You do that by clicking the Link icon in the bar just above the Grasshopper canvas that contains the script that you are trying to link.

To launch a sample file

The sample files are provided with the Grasshopper-BricsCAD Connection. They can show you what is possible with the Connection. They are stored in the Program Files\Bricsys\Grasshopper-BricsCAD Connection folder.
  1. Open up a sample .dwg file by opening a .dwg from the Program Files\Bricsys\Grasshopper-BricsCAD Connection folder.
  2. You will get a warning that the file is read-only. This happens because the document is located in a secured folder. Click Yes to open as read-only.

    Optional: If you don't want this warning, or if you want to edit the file, copy-paste the sample files into one of your own folders and open them from there instead.

  3. From inside Grasshopper, choose File > Open Document. Go to the Program Files\Bricsys\Grasshopper-BricsCAD Connection folder again.
  4. Choose the .ghx-file with the same name as the .dwg file.
  5. The sample file now opens and you should see a red preview of the geometry in your BricsCAD® model space.

    Make sure you don't close the Grasshopper window, otherwise the preview geometry will disappear, as the Grasshopper document is closed. If your Grasshopper script is open and you still don't see the preview geometry, it probably means your Grasshopper file is linked to the wrong BricsCAD® document. To link it to the correct one, see To link a Grasshopper file with a BricsCAD file.

  6. You can play around with the input sliders in the Grasshopper script.
  7. If you are happy with your model and would like to convert the preview geometry into real BricsCAD® geometry, you can 'bake' the geometry into BricsCAD®. You do that by selecting all the Bake Building Element components (Shift-clicking them all) and pressing the Bake button .
  8. A pop-up window appears, just click OK to accept.
  9. The geometry is now converted into real BricsCAD® geometry, even with BIM data attached to it.
  10. You won't be able to save your changes to your files, as they were read-only. So, discard your changes or save the files as new ones in a different location.

Customizing the Rhino/Grasshopper connection

The code for the Rhino/Grasshopper Connection is 100% open-source and is available at https://github.com/Bricsys/rhino.inside-bricscad. This allows you to fully customize your Connector by coding to your heart's content (assuming, of course, that you know how to code).

Uninstall the Rhino/Grasshopper connection

  1. Launch Add or Remove Programs in Windows.
  2. Search for Grasshopper-BricsCAD connection.
  3. Hit Uninstall.

How to draw a box in Rhino and bake into BricsCAD via Grasshopper

  1. Open a new BricsCAD® file.
  2. Save the file.
  3. In BricsCAD®, click on Grasshopper > Rhino.
  4. Draw a Rhino box by typing BOX in the Rhino Command line. (This works in the same way as the BricsCAD BOX command).
  5. Click for the first corner of the base.
  6. Click for the other corner of the base.
  7. Click to define the height of the box.


  8. To open a new Grasshopper script, inside the Grasshopper environment, click on Grasshopper > Grasshopper then click on File > New Document.


  9. Save the file.
  10. Drag and drop the Params > Geometry > Brep component onto the Grasshopper canvas.
  11. Right-click on the component and select Set one Brep.


  12. Go to the Rhino canvas and select your cube.
  13. The Brep component will change color from orange to grey. If you close the Rhino window and return to the Grasshopper window, a preview of the cube will display in the BricsCAD model space.
  14. Drag and drop the BricsCAD > Building Element > Bake Geometry component onto the Grasshopper canvas.
  15. To link the two components, click and drag from the Brep component's right dot to the BricsCAD Bake component's left dot.


  16. Right-click onto the Bake Geometry component and choose Bake into BricsCAD.


    The following dialog displays. Here you can choose the destination Layer, Material and Color:


  17. Click OK. The box is baked as a solid into BricsCAD.

How to draw a box in Grasshopper from a BricsCAD rectangle

  1. To open a new Grasshopper script, click on Grasshopper > Grasshopper and clicking on File > New Document inside the Grasshopper environment. Save the file.


  2. Open a new BricsCAD file in a meter template and save it.
  3. To link the new script to the open .dwg file hit the Link button in the Canvas Toolbar.


  4. Go to the BricsCAD model space and draw a rectangle.
    Note: Use a polyline to create irregular geometry.
  5. Drag and drop the BricsCAD > Input Geometry > Curve component onto the Grasshopper canvas.
  6. Right-click onto the Curve component and choose Set One BricsCAD Curve.
  7. Go to the BricsCAD model space and select the rectangle.
    Note: Save time with the Quad: select the curve in BricsCAD and then select ToGrasshopper under the Grasshopper tab of the Quad. A Grasshopper component appears in the upper left corner of your Grasshopper canvas.
  8. Link the Curve component to a Surface > Freeform > Boundary Surfaces component.
  9. Link this to a Surface > Freeform > Extrude component.
  10. In the Direction input of the Extrude component link a Vector > Vector > Unit Z component with Params > Input > Number Slider component. Set this to the height of your box, 17 for example.
    Note: You can edit the range and preciseness of the slider by right-clicking the component and selecting Edit.... A dialog box pops up where you can set the digits and min and max value of the slider.


  11. You now have drawn a box in Grasshopper, using BricsCAD geometry as an input.

How to split up a box into different floors using Grasshopper

  1. Add the Start_1.ghx-code to your previous Grasshopper script.
    • You do that by downloading the zip file at the bottom of this page and extracting its content.
    • Then open the Start_1.ghx file by going to File > Open Document... in your Grasshopper window.
    • You can now select all of the Grasshopper code by hitting Ctrl+A on the keyboard and copy it using Ctrl+C.
    • Then switch back to the document you were working on in the previous procedure by going to the upper right corner of the Grasshopper window and clicking on the title of the current document (Start_1).
    • You then get a drop-down of all the active Grasshopper scripts, so open the one you saved in How to draw a box in Grasshopper from a BricsCAD rectangle.
    • Now click on the canvas and hit Ctrl+V to paste the Start_1.ghx-code.
  2. Right-click to rename the number slider from the previous procedure to Height building.
  3. Link this number slider to input A from the Division component in the Compute amount of stories group and to input A from the Subtraction component in the Get last wall height group.
  4. Link your extrusion to the Shape input of the Contour component.


  5. Do some cleaning up of the file:
    • Drag the green Input group to the front of your canvas.
    • Add the Height building slider to the group by selecting the component and then right-clicking on the group and choosing Add to group.
    • Put off the preview for your Boundary and Extrusion components: select the components (Shift-click them) and right-click on an empty space of your canvas and choose Preview Off.
  6. (Optional) For intermediate files that already have these changes, use Intermediate_1.ghx and Intermediate_1.dwg. (Located in the zip file at the bottom of this page.)
  7. The script you just made allows you to:
    • Divide the extrusion per slab height, using the Contour component.
    • Offset the curves by the thickness of the walls.
    • Make the bottom surfaces of the walls (the surfaces are split into lower floor walls and roof walls).
    • Compute the last wall height.
    • Extrude the surfaces into roof, slabs, and walls.
    • Adapt the height of the building, the height of the stories, and the thickness of the slabs and walls, by using the sliders in the green Input group.
  8. Add 3 BricsCAD > Building Element > Bake Building Element components to the end of your Grasshopper script.
  9. Attach the extruded elements (the Flip components) to the Geometry input nodes of the Bake Building Element components:
    • Connect the extruded lower floor walls and extruded roof walls to one Bake Building Element component. (Hold Shift while connecting multiple nodes to one input node).
    • Connect the extruded lower floor slabs to another Bake Building Element component.
    • Connect the extruded roof to the remaining Bake Building Element component.
  10. Add the following components to your canvas from the BricsCAD > BIM Data category: 1 Buildings, 1 Stories, and 3 BIM Types components.
  11. Attach Buildings to the Building input of the Stories component and attach this to the Spatial Location input of all the Bake Building Element components.
  12. Attach BIM Types (set respectively to BimWall, BimSlab, and BimRoof in the selection menu) to the Element Type input of the Bake Building Element components of the extruded walls, the slabs, and the roof respectively.
  13. The following warning will display: Input parameter Building failed to collect data. This is because, when no buildings are defined in the BricsCAD drawing, Grasshopper fails to collect input.


  14. To make spatial locations, for the component to detect, go to BricsCAD and click on Home > Classify > Spatial Locations.
  15. Add a building and a few stories (more stories than you want to divide your building into).


  16. Go to Grasshopper and right-click the Buildings component and put it onto Drop-down List instead of Check List.


  17. Select the newly made building in the drop-down list.
  18. Shift-select all the Bake Building Element components and choose the Bake option from the Canvas Toolbar. Click OK to accept the Layer, Material, and Color.
  19. The drawing will now have different floors.
    Note: Check the properties to see that the geometry is correctly classified as Wall, Slab or Roof. These elements will also have a spatial location assigned to them.


  20. The last input geometry will be baked onto all remaining stories as there are now more stories than geometry. To correct this, select a correct subset of the stories to assign. Bake the geometry in BricsCAD® and the stories will be correct. No duplicate geometry will be baked.

    You can see how it's done by opening the End_1.dwg and then opening the Grasshopper file End_1.ghx that is linked to the End_1.dwg.

  21. You have now successfully created a building.
    If you want to see the result of the baked building, check the file End_1_Baked.dwg or bake it yourself.


How to add a railing to the top of the building

We will continue with the building made in the previous procedure. So open the End_1.dwg and then open the Grasshopper file End_1.ghx that is linked to the End_1.dwg.

  1. Add the Start_2.ghx-code to the Grasshopper canvas.
    • You do that by downloading the zip file at the bottom of this page and extracting its content.
    • Then open the Start_2.ghx file by going to File > Open Document... in your Grasshopper window.
    • You can now select all of the Grasshopper code by hitting Ctrl+A on the keyboard and copy it using Ctrl+C.
    • Then switch back to the document you were working on in the previous procedure by going to the upper right corner of the Grasshopper window and clicking on the title of the current document (Start_2).
    • You then get a drop-down of all the active Grasshopper scripts, so open End_1.ghx.
    • Now click on the canvas and hit Ctrl+V to paste the Start_2.ghx-code.
  2. Link the Extrude Roof group's end component to the Brep input of the Deconstruct Brep component of the Select top face of roof group.


  3. The script does the following:
    • The Select top face of roof group will select the top face of the roof.
    • The remaining script will take that face and use it to make the baselines for the railing.
    • It will then make the axes of the supporting columns and beams.
    • It will also calculate half of the height of the beam profile.
    • There is still a profile required, however, to complete this step and the following one. We will, therefore, create a profile from step 6 onward.
    • With that profile and the axes, the beams and supporting columns are made as extrusions.
  4. The intermediate result is found in the Intermediate_2.ghx and Intermediate_2.dwg files. (Located in the zip file at the bottom of this page.)
  5. (Optional) Skip the Select top face of roof group and replace it with a BricsCAD > Input Geometry > Face component. Set it to the top face of the roof slab in your BricsCAD baked building. (Do this by right-clicking on the component, click on Set one BricsCAD face and select the face in the BricsCAD drawing). Connect this Face component with a Params > Geometry > Surface component and connect this surface to the correct inputs.
  6. Go to BricsCAD > BIM Data.

    Drag the Profile Names and the Profile Sizes components onto the canvas.

  7. Select HEA from the drop-down list in Profile Names. This drop-down list displays all the names of the profiles in the Profile Library of BricsCAD.
  8. Link the component to the input ProfileName of the Profile Sizes component.


  9. Link the Profile Sizes component to the input node List in a Sets > List > List Item component, where i is set to 4 (right-click on the i input and Set integer to 4). This List Item lets you pick one size from the list with all available profile sizes for the Profile Name linked to it.
    Note: If you link a Params > Input > Panel component to the Profile Sizes output, you will see that the index 4 stands for size 160.


    Link the Profile Names and List Item components to the BricsCAD > Information > Library Profile component, to get an HEA 160 profile as an output.


  10. To get the curves that make up this profile, attach a BricsCAD > Information > Profile Info component to the Library Profile. One of the outputs created is the Profile Curves as a tree.
  11. Attach a Surface > Freeform > Boundary Surfaces component to the Profile Curves output node. This is to later extrude the surface as a solid, instead of the lines as a surface.


  12. To group together the components just created, select them (with a selection box) and right-click on Group.
  13. (Optional) To rename the group, right-click on the purple rectangle. Rename the group in the upper text box, e.g. to Make profile.


  14. The Boundary Surfaces component should now be linked to the Content input of the Bounding Box component of the Calculate half of height of beam group. The Boundary Surfaces component should also be linked to the two Profile inputs of the Extrude components in the groups Make supporting columns and Make beams. The extrusions should now show you a railing with HEA 160 beams and columns.


  15. To bake those beams and columns into BricsCAD attach two BricsCAD > Building Elements > Bake Building Element components to the Grasshopper canvas.
  16. Do the following:
    • Set the Geometry input to the extrusions.
    • Set the Element Type input to a BricsCAD > BIM Data > BIM Types component, which is set to BimColumn for the column extrusions and to BimBeam for the beam extrusions.
    • Set the Spatial Location input to the same as the roof.
    • Set the Profiles input to the Library Profiles component from the Make profile group.
  17. You now successfully created a railing on top of your building. (The full script to do this is in the End_2.ghx file at the bottom of this page, which is linked to the End_2.dwg.)
  18. Bake into BricsCAD. The profiles are now set to the one in the Grasshopper script. You can still modify the connections of the beams in the corners by using L-Connect in BricsCAD. (To see the finished building with the railing on top of it, check out the End_2_baked.dwg file at the bottom of this page.)

Procedure: add information to a baked model

We will continue with the building made in the previous procedure. So, open the End_2.dwg and then open the Grasshopper file End_2.ghx that is linked to the End_2.dwg.

  1. Add the Start_3.ghx code to the canvas.
    • You do that by downloading the zip file at the bottom of this page and extracting its content.
    • Then open the Start_3.ghx file by going to File > Open Document... in your Grasshopper window.
    • You can now select all of the Grasshopper code by hitting Ctrl+A on the keyboard and copy it using Ctrl+C.
    • Then switch back to the document you were working on in the previous procedure by going to the upper right corner of the Grasshopper window and clicking on the title of the current document (Start_3).
    • You then get a drop-down of all the active Grasshopper scripts, so open End_2.ghx.
    • Now click on the canvas and hit Ctrl+V to paste the Start_3.ghx-code.


  2. This code has some post-baking settings of classified and baked beams and columns:
    • The script uses the Get Properties Names component to display the BIM properties in the Property category Bricsys.
    • In those properties, it selects item 1 for the columns and item 0 for the beams, ColumnType and BeamType respectively.
    • To conclude, it sets the properties to the value specified in the Panel components, using the Set Property Value components.
  3. To make the script work, bake the two Bake Building Element components that make up the railing.
  4. Now link the Building Element output of the Bake Building Element components to the respective Building Element input of the Get Properties Names components.
  5. Also, link the Building Element output of the Bake Building Element components to the respective Building Element input of the Set Property Value components.
  6. If you now select a column in BricsCAD and open its Properties, the ColumnType will be set to Steel column. When you change the value of the Panel component, the Properties in BricsCAD change in real-time.
  7. The resulting script: 'End_3.ghx' can be found in the zip file, located at the bottom of this page. It works with the 'End_3.dwg' file in which nothing is yet baked. Bake all the Building Elements, to get the post-baking settings.


The BricsCAD toolset in Grasshopper

Icon Name Description


Plane Represents a plane in BricsCAD.


Point Represents a point in BricsCAD.


Curve Represents a BricsCAD curve.


Entity Represents a BricsCAD entity.


Edge Represents a BricsCAD edge.


Face Represents a BricsCAD face.


Vertex Represents a BricsCAD vertex.


Buildings Provides a name picker for all the buildings present in Spatial Locations in BricsCAD.


Stories Returns all the stories attached to the input building.


Profile Names Provides a name picker for all the profiles present in Profiles in BricsCAD.


Profile Sizes Returns all the sizes attached to the input profile.


BIM Types Provides a type picker for all the BIM Types available in BricsCAD.


Property Categories Provides a category picker for all the property categories available in BricsCAD.


Bake Geometry Bake the Grasshopper geometry into the current BricsCAD drawing, while disregarding the BIM data attached to it. The output of Bake Geometry is a reference to the baked building element without BIM data.


Bake Building Element Bake the Grasshopper geometry into the current BricsCAD drawing, while adding BIM data to it. The output of Bake Building Element is a reference to the baked building element with BIM data.


Elements on Spatial Location By default, returns all the building elements present in BricsCAD. When using input parameters, returns the building elements filtered by element type and/or spatial location.


Library Profile Returns a profile from the library, according to the given name and size.


Profile Info Returns the information (name, size, standard and curves) of the specified profile.


Property Names Returns the property names, attached to a building element, in the specified property category.


Property Value Returns the property value, attached to a building element, for the specified property name and category.


Linear Solid Info Returns information (axis, extrusion path and profile curves) about a linear solid present in the BricsCAD drawing.


Set Property Sets the property value of the building element according to the specified name, category and value.


IFC Export Exports the specified building elements to IFC.


Link Links the Grasshopper script to the open BricsCAD .dwg file.


Bake Bakes the geometry from the selected Bake Geometry and Bake Building Element components.

Starter files.zip