Slab Grasshopper Styles Tutorial

Comparison between the Grasshopper slab on the left and the VisualARQ slab on the right.

This tutorial will create a parametric slab style from a Grasshopper definition. This tutorial also works for the roof object, which follows the same principles as the slab object.

The 3 main steps to follow are the same as in any other Grasshopper style:

  1. Grasshopper definition setup
  2. Create the VisualARQ slab style
  3. Insert and edit the slab Grasshopper style

1. Grasshopper definition setup

Prerequisites to consider when creating a Grasshopper definition for a slab Grasshopper style:

  • Slabs in VisualARQ are created from a boundary curve or a planar surface. It is necessary to have a Curve parameter or a Surface parameter that will act as a linked property with the slab boundary.
  • Even though this example uses a Curve parameter as the slab boundary, it is recommended to use a Surface parameter as a slab boundary (linked properly) for the vaSlabAdd and the vaSlabSubtract commands to work properly with the resulting slab.

Download the Grasshopper file used in this tutorial here.

Type Grasshopper in the Rhino Command line to launch Grasshopper.

The Grasshopper definition requires some Input parameters to define the features of the new object, and Output parameters to define the geometrical components of the final object. Some output parameters can be used to retrieve information from the object created.

  • Input parameters: These are the components that will define the features of the resulting slab style:
    • Number Slider (floating point): A total of 6 sliders have been used for the various dimensions of the slab.
    • Curve parameter: used for the boundary curve of the slab (the linked property).
  • Output parameters: These are the components that will be read by VisualARQ once we create the style. VisualARQ only recognizes the output parameters that are ending components with their output nodes unconnected. In this example, we find the following output parameters:
    • Geometrical outputs: these are the ones that will be read as the different parts of an object style. In this case there are two Brep components, one for the concrete and one for the metal sheet.
    • Output parameters: these are used to retrieve information from the object created. In this example there is one Number Param which will tell us the concrete volume of the final object.

It is important to name these components in Grasshopper to identify them easily when creating the new style:


2. Create the VisualARQ slab style

The Grasshopper style will be created and managed from the Slab Styles Properties dialog.

2.1 Create the new style

Slab styles dialog.
  1. Assuming the Grasshopper definition (.gh file) is already done, open the slab styles dialog: _vaSlabStyles command.
  2. Click on the New… button and select the Grasshopper slab style option.

The Grasshopper Style wizard will appear. This wizard will guide you through the steps to define the slab Grasshopper style parameters. The left side of the wizard will show a preview of the object style generated as soon as the required information is completed.

2.2 Open the Grasshopper definition

Grasshopper styles wizard. Browse the Grasshopper definition.

Click on the Browse button to select the .gh file or choose one of the recent files from the drop-down list.

2.3 Configuration

Grasshopper styles wizard: Configuration

Set the Slab Grasshopper style global values:

  • Style name: set the desired name.
  • Definition units: in this case, it has been prepared in millimeters.
  • Linked properties: an input curve parameter component representing the boundary should be selected. (As mentioned before, it is recommended to use a surface parameter instead). The name displayed in the list is the one assigned to that component in the Grasshopper file.

2.4 Geometry

Grasshopper styles wizard: Geometry

Specify which of the output geometry components (Params) to import into VisualARQ. The identifiers of these geometry components are taken from the names of the geometrical output components in the Grasshopper definition and can be modified only once the style has been created.

You can choose the representation where each component is going to be used:

  • Model: the object representation in 3D.
  • Plan: the object representation in plan view. Only visible in top views when the Cut Plane of the level where the object is placed is enabled and intersects the object.
  • Preview *: the object representation while the object is being inserted (or moved afterward). This way, you can have a preview of the final object before ending the command.

*Note: It is highly recommended to use the Preview representation only for the necessary geometry to be displayed while inserting the object in the model. The fewer components checked for the preview, the faster will be the insertion or edition of these objects in the model, especially when they are made with complex Grasshopper definitions. Beware to leave at least one component with this representation checked.

In this case, there are two brep outputs that we want to show in the three different representations: model, plan, and preview. The Plan representation will be taken from the horizontal section of the 3D objects according to the level’s cut plane height.

2.5 Parameters

Grasshopper styles wizard: Parameters configuration

This step shows the settings available for the list of input and output parameters defined in Grasshopper. The “Filter by” option lets you view the parameters located inside named groups in the Grasshopper definition (but in this case, it is not relevant, since in the Grasshopper definition there was just one group for the input parameters and another one for the output parameters). There are two kinds of parameters:

  • Input parameters: these parameters define the slab style.
  • Output parameters: these parameters retrieve information from the object created.

The settings are different for each of them:

  • Input parameters:
    • Name: it is the identifier of the parameter and can be modified if desired in this step.
    • Editable by (you can change this value for several parameters by selecting them while holding the Ctrl key.):
      • Definition: the parameter will be hidden and it will keep the value from the Grasshopper definition.
      • Style: the parameter can be edited only by style and the changes will apply to all objects in the model with that style.
      • Object: allows to set a different value for that parameter for each slab in the model that has the same style. In case no value is provided “By object” the one defined by style will be used.
    • Default (value): shows the default value (the ones specified in the Grasshopper definition) for the input parameters and lets you set different default values.
    • Type: shows the different types of values available for each kind of parameter. In this case all of them are floating point values which have automatically been set to Length.
  • Output parameters:
    • Name: it is the identifier of the parameter and can be modified if desired in this step.
    • Visibility: choose the option “Object” to display this parameter in the VisualARQ dialogs, or “None” to hide it.
    • Type: shows the type of value which has previously been defined in Grasshopper for this parameter.

3. Insert and edit the slab Grasshopper Style

3.1 Edit the slab style

Slab Grasshopper style parameters in the Slab styles dialog.

Once the Grasshopper style wizard is completed, the new style will appear in the slab styles list. To edit the style again, right-click on the style name to open the context menu and select Edit. This operation will open the Grasshopper-style wizard again.

The input parameters will be available under the “Parameters” tab and will appear grouped as in the Grasshopper definition. In case the name of the group matches an existing category they will appear in the same category.

3.2 Insert the Grasshopper style

Once the slab style is created, you can insert an instance in the document and change the values of its parameters from the VisualARQ slab icon located under the Properties panel, as it works with any other VisualARQ object. Only those input parameters that were set as editable “By Object” in step 2.5 will be visible. You will see the output parameters in this part of the Properties panel as well.

This slab can be also inserted using the Slab: From Curves and the Slab: From Surface commands.

Slab parameters in the slab Object Properties panel.