Grasshopper Component

Tekla Structures
Not version-specific
Tekla Structures
Grasshopper
Environment
Not environment-specific
Image
Grasshopper Spiral Staircase

 

Download the component from Tekla Warehouse.

Are you looking for the Grasshopper-Tekla Live Link?

Back to top

About

Run your favorite Grasshopper definition as a traditional Tekla component, without needing to be exposed to the spaghetti powering it all! Or develop your own Tekla custom components using visual scripting.

 

The Grasshopper Component in Tekla Structures can trigger any Grasshopper definition to generate objects in Tekla, but it looks and behaves like a traditional Tekla component. Select a Grasshopper definition in the component dialog, and the component will ask you to pick required inputs in Tekla. The component dialog is automatically populated with properties that are extracted from the parameters in the definition. The Grasshopper sliders are brought over to Tekla as well, enabling true parametric modeling flexibility.

Back to top

Demo videos

Using the Grasshopper Component

Creating a new Grasshopper Component type

Back to top

Resources

Grasshopper Component plugin for Tekla Structures tsep installer:

Grasshopper Component on Tekla Warehouse

 

Some definition examples that work well as a component, created with the Default environment:

Grasshopper Component - Definition Examples

 

Here's a Grasshopper definition example showing the different elements that can be used to design the dialog and behavior of the Grasshopper component:

Grasshopper Component Template

Back to top

Prerequisites

The component requires these tools installed on the same machine:

 

Note that a Rhino license will be reserved whenever a component is inserted or modified, not just when creating a new component type in Grasshopper. To release the Rhino license after using the components, Tekla Structures must be closed.

Back to top

Installing the component

  1. Make sure you have Rhino 7 and the Grasshopper-Tekla link version 1.10 (or newer) installed.
  2. Install the Grasshopper Component plugin from the tsep and restart Tekla Structures.
  3. Once the component is installed, it will show up in the Component Catalog in Tekla Structures.
    Image
    Grasshopper Component icon
Back to top

Using the component

Note: you don't need to have Rhino/Grasshopper running, it will be launched when needed.

  1. Double-click the Grasshopper component icon in the Component Catalog to open the component dialog.

  2. In the component dialog there's a field where you can set the path to the Grasshopper definition you'd like to use.

    Image
    Grasshopper Plugin Definition Path

     

  3. Once the Grasshopper definition path is set, Rhino.Inside.Tekla will be loaded (which takes a couple of seconds the first time it's done during a Tekla session).

  4. The component dialog will be populated with the properties that are found in the Grasshopper definition parameters, and the component is ready to be inserted.
  5. Click the component icon again to insert it (like with any other component). The message bar in Tekla will tell you what to pick, based on the model input parameters found in the definition.
  6. The definition will run in the background and generate objects in Tekla Structures.

 

The units used when the component solves the definition will be taken from the units of the Tekla Structures model.

Back to top

Component dialog interface

The dialog includes standard component dialog controls like Save, Load, Modify, OK and so on.

 

Topmost in the dialog there’s a field for the path to the Grasshopper definition, along with buttons to select a definition from the file system, reload the definition and edit the definition in Grasshopper.

 

Properties extracted from the definition will be shown in the dialog as normal component properties, i.e. with a text box or drop-down for changing the values and a check box for filtering. Number Sliders from the definition will get a slider in the component dialog as well, next to the numerical value.

Image
Grasshopper Component dialog

 

When a slider, dropdown or button is used to set a property in the dialog, the new value is applied immediately on any selected component instance in the Tekla model.

 

If you edit a value in a property text box directly (e.g. without using the slider), the new value won't be applied immediately. This way you can modify several values without needing to wait for the selected component to update. You can press Enter to apply the values to the selected component.

 

For inserting line breaks in a property field containing text, \n can be used.

Properties can be grouped into tabs and groups by modifying the definition in Grasshopper. See Grouping properties and changing their visibility below.

You can save presets in the component dialog, like for any component. The preset includes which Grasshopper definition is being used.

Back to top

Creating a new component type

Any Grasshopper definition used in the component can be regarded as a separate component type.

To create a new component type from scratch,

  1. Open an empty Grasshopper definition in a standalone Rhino/Grasshopper instance.
  2. Craft the Grasshopper script as you normally would, with Tekla components creating objects in Tekla.
  3. Save the definition.
  4. Point the Grasshopper Component dialog in Tekla Structures to the new definition. Parameters are loaded into the dialog and the component can be inserted.

To edit the component, you can modify the definition in Grasshopper, save it and then re-load it from the component dialog. See "Editing a definition" later in this document.

The following sections of this document outline what parameters and inputs are transferred from Grasshopper to the Tekla structures dialog and how you can customize the dialog.

Back to top

Model inputs for the component

Model inputs (i.e. what the user is asked to pick) will depend on the selected Grasshopper definition and will be extracted from the following floating params within the definition:

  • Tekla Point, Tekla Line and Tekla Polyline params
  • Model Object params (Beam, Plate param etc)
  • Construction Object params
Image
GrasshopperComponentPlugin-ModelInput

For the params to be used as input, they should be enabled, not have any input wires, and be connected to something downstreams.

So if you have e.g. a Beam param in the definition, on insertion the component will ask the user to pick a Beam in Tekla structures. A Tekla Point, Line or Polyline param will make the component request a point, line or polyline as input. Construction object params will request a construction object.

The order the inputs are asked in will be the visual order of the parameters in Grasshopper, from top to bottom.

To make the component request multiple points or beams as input, the prefix "Multiple" (not case sensitive) can be added before the parameter name in the definition. The last part of the name can still be changed of course.

Image
multiple points or beams

The short form "m:"can also be used as the prefix (if the short form is used, the prefix will not show up in the Tekla prompt when picking objects).

Note: The Grasshopper components are subject to the same limitations as other Tekla components, e.g

  • There can be a maximum of 10 different model input params.
  • In total, a maximum of 99 points or model objects can be picked as input when inserting any single component.
  • it’s not possible to make a component request multiple lines or polylines as input by using the "Multiple" prefix, only multiple points or model objects.
Back to top

Properties in the component dialog

The properties that are shown in the component dialog will depend on which Grasshopper definition is selected, and will change if you select another definition.

The available properties are extracted from the following floating params and components in the Grasshopper definition:

  • Panels
  • Number sliders
  • Value lists
  • Boolean toggles
  • Text, Integer and Number params + params derived from these like the File Path param.
  • Tekla Catalog components (e.g. Profile Catalog component)

These params will be exposed as properties in the component dialog in Tekla Structures, as long as they are enabled, don’t have any input wires and are connected to something downstreams. The property labels will be the names of the parameters/sliders/panels/lists in Grasshopper, and can thus be easily edited in the definition.

Image
GrasshopperComponentPlugin-Attributes


The order of the properties will be the visual order of the parameters in Grasshopper, from top to bottom.

Back to top

Showing images and additional text in the dialog

Images can be shown in the dialog. To do this, add an Image Sampler component to the definition. It's not possible to scale the image, so use an image of appropriate size.

 

To add additional text to the dialog, add a panel without a name to the definition. The text in the panel will be displayed in the dialog. The panel should NOT be connected to anything downstreams (then it would become an input parameter as normal).

Image
GrasshopperComponentPlugin-ImagesNText
Back to top

Grouping dialog elements and changing their visibility

By default, all floating Grasshopper params, panel texts and images listed above are exposed as properties or displayed in the Tekla component dialog, except for params or components that are disabled, have an input wire, or aren't connected to anything downstreams.

 

You can organize properties and images into tabs and groups in the component dialog. This is done by sorting the parameters or images into groups in Grasshopper and using the prefix "Tab:"or "Group:"before the group name (not case sensitive). The short forms "t:" or "g:" can also be used as prefixes.

Image
GrasshopperComponentPlugin-TabsNGroups2

 

 

Groups with tab and group prefixes can be nested in Grasshopper to create tabs that contain groups in the component dialog. The same tab or group name can be used in multiple places in the Grasshopper definition; in that case the params inside the Grasshopper groups with the same name will be collected into a single tab or group in the component dialog.

 

If any group with a tab or group prefix is found in the Grasshopper definition, any params or images that don’t belong to a prefixed group won't be shown in the component dialog.

 

If desired, a param within a prefixed group (which would normally be exposed in the component dialog) can be filtered out by including the parameter in another (nested) group that is named Hidden.

Back to top

Setting Tolerances

The Rhino tolerance when solving is set to 0.1 mm per default, and the angle tolerance to 0.1 degrees. To change this, add a panel and name it "Rhino Tolerance" or "Rhino Angle Tolerance" respectively somewhere on the canvas, and add the tolerance value as text to the panel.

Image
GrasshopperComponentPlugin-Tolerances.png

If these panels are used, a tab called "Settings" will show up in the plugin dialog where the values can be adjusted separately for any plugin instance.

Keep in mind that a too low value for the tolerance might result in problems. For example it might make the meshing too fine around the edges of cuts, making the item insertion fail in Tekla. As a comparison the internal tolerance in Tekla for detailing operations is in the order of 0.3 mm.

Back to top

Outputs

When a component runs in Tekla, the following components in the Grasshopper definition will always be solved:

  • Components that create objects in Tekla (from the Grasshopper-Tekla link)
  • Components that modify objects in Tekla (from the Grasshopper-Tekla link)
  • C# and other scripting components

Upstreams components connected to any of the above components will also be solved, including user objects and 3rd party library components.

To force solving of any component not in the above list, insert a panel and name it "Solve" or just "S". Then connect the component to this panel, and it will be solved along with any other upstreams components.

When the definition runs, critical messages from the Tekla components will be shown in a messages dialog that pops up in Tekla. You can show custom messages in this dialog by adding a panel to the definition and change its name to start with "Output" or "O:" and then connect something to the panel's input. The content of this panel will show up in the messages dialog. Similar to a "Solve" panel, this will also cause all upstreams components to solve.

Image
GrasshopperComponentPlugin-OutputPanels
Back to top

Editing a definition

Each time an inserted component is modified, it will call the Grasshopper definition file. This means that editing a Grasshopper definition will change the behavior of any already inserted components that use that definition, if the inserted components are modified in the future.

Note: Adding or removing parameters in a definition means that property values for already inserted components in Tekla might become invalid.

The Grasshopper definition can be opened directly from the component dialog for viewing or (light) editing by using the Pen button.

Image
Grasshopper Plugin Definition Path

 

When opening a definition this way, the Grasshopper solver will be disabled. Note that this quick editor has some limitations (selections behave weirdly, you can’t pick in Rhino or Tekla, objects get generated in the wrong locations).

Because of the above limitations, it's recommended to open the definition in a stand-alone instance of Grasshopper instead for any substantial editing.

Once you have edited and saved the definition in Grasshopper, you can reload the definition from the component dialog to read in the updates using the Reload button.

If you now modify already inserted components from the dialog or by changing their inputs, they will adjust according to the updated definition.

Back to top

Things to consider

  • Using Rhino.Inside requires a license of Rhino, and the license will be reserved the first time the Grasshopper Component is triggered during a Tekla session. In case you’re using a floating license system, make sure that there is a Rhino license available prior to opening the Grasshopper component. Otherwise the component might freeze Tekla Structures because it can’t get hold of a license.
    • The Rhino license will be released once Tekla is shut down or restarted. Because of how Rhino.Inside works, there’s no way to release the license manually without terminating the Tekla process completely.
  • Property parameters can be single-item only, which means it’s not possible to send lists to the definition from a Tekla component. Multiline text input is possible though, by using \n as the line break in the dialog text fields.
  • Text-based, integer, number and Tekla Catalog type params can be converted to component properties. To expose other kinds of params like time, intervals or GUIDs they need to be added to the Grasshopper definition as e.g. text params, and the text value can then be converted to the appropriate type further downstreams in the defintion.
  • There can be a maximum of 100 integer (int) params, 100 number (float) params and 100 text (string) params loaded into the dialog as properties from a definition. E.g. Value Lists and Tekla Catalog params are counted as text.
  • The Grasshopper components are subject to the same limitations as other Tekla components, e.g
    • There can be a maximum of 10 different model input params.
    • In total, a maximum of 99 points or model objects can be picked as input when inserting any single component.
    • It’s not possible to make a component request multiple lines or polylines as input by using the "Multiple" prefix.
  • Properties in any saved component preset file will be named generically e.g. string_0, string_1, string_2 etc. This cannot be changed.
  • Opening the Grasshopper definition from the component dialog for editing or running might not be smooth (selections behave weirdly, you can’t pick in Rhino or Tekla, objects get generated in the wrong locations etc). Light editing is usually fine, otherwise you can edit, run and test the definition more smoothly by opening a stand-alone Rhino and Grasshopper instance.
Back to top
Was this helpful?