Skip to main content

Β· 2 min read
Marco Pellegrino

One use case where the API is leveraged is the modification of some of the properties of an object such as Slab, Bar, Axis ect ect.

The "Grasshopper way" to modify an object requires to create a new one starting from the properties of the deconstructed object and insert the new values where needed. The example below shows how to modify the thickness of a Slab.

construct-deconstruct

However, there is a better/improved/faster way to do modify properties. It only required few knowledge of programming and it is my favorite way to manipulate data inside the FEM-Design model.

Let's say that we want to modify the thickness of a slab and the identifier of a beam of an existing model.

The step to follow are:

1. Create a python component
2. Add the required input for your script. Zooming in the python component will allow you to add as many input as needed.
3. Right click on the generated input in order to change the name and set the `type`.
4. Write your code to modify the properties.

python

Bar example​

import copy

import clr
clr.AddReferenceToFileAndPath(r"C:\Users\Marco\AppData\Roaming\Grasshopper\Libraries\FemDesign\FemDesign.Core.dll")
#You must reference the FemDesign.Core.dll using the location on your machine


new_bar = copy.deepcopy(x)
new_bar.Identifier = identifier

One of common mistake when modifying object in Grasshopper is NOT doing the copy of the object that we want to modify. The copy will kind of detach the original object from the new one so that the modification will not be upstream.

After the copy, we need to find the properties to modify navigating through the object with the use of character .

new_bar.Identifier = identifier is selecting the Identifier of the new_bar and it is setting the identifier to it.

Slab example​

import copy

import clr
clr.AddReferenceToFileAndPath(r"C:\Users\Marco\AppData\Roaming\Grasshopper\Libraries\FemDesign\FemDesign.Core.dll")
#You must reference the FemDesign.Core.dll using the location on your machine

new_slab = copy.deepcopy(x)

new_slab.SlabPart.Thickness[0].Value = tck

The slab example is basically the same but, due to a different data structure, we need to select a list item and set the value to it.

You will end up in really clean workflow which will not scare people and easy to maintain :)

gh-workflow

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

Β· One min read
Marco Pellegrino

grasshopper

Double sections such as 2L are widely use in steel structures but, unfortunately, FEM-Design does not ship these kind of geometries out of the box.

However, with some few steps and the API, you can create a custom library that you can use over and over again.

Let's try to summarise the steps first.

  1. Select all the LE shape sections from the Database

step_1

  1. Apply a mirror transformation to the section surfaces. In our case, I have applied a mirror at a specific distance which represent the space between the L shapes.

step_2

  1. Construct a custom section specifying GroupName, TypeName and SizeName. The input will be used by #FEM-Design as shown in the picture below.

step_3

group

You can now import your brand new pool of sections in FEM-Design!

I have already talked about custom section and you might be interested in reading this blog post.

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

Β· 2 min read
Marco Pellegrino

grasshopper

One of the most fascinating topics in the application of parametric design in engineering is optimization. It's hard to find an engineer who works with Grasshopper and hasn't tried their hand at optimizing using Galapagos. This process can often be quite straightforward as we can obtain real-time outputs like mass, deflection, and utilization by adjusting various parameters.

So, how do we go about it? The following example should help illustrate the setup:

- the analysis (static analysis)
- the design settings (check, auto-design, apply changes)
- the design parameters (utilisation)

Design settings and parameters​

grasshopper

Design parameters are currently linked to a text file. The cfg.xml file template can be found in the plug-in folder installed by Package Manager in %AppData%\McNeel\Rhinoceros\packages\7.0\FemDesign\

The file has several parameters that you can modify as you pleased. In case of steel bars, you can use something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<configs>
<CONFIG fIgnoreAnnexForShearStrength="false" StripeWidth="1" type="CCMSCONFIG"></CONFIG>
<CONFIG type="CCCOCONFIG"></CONFIG>

<!-- EUROCODE STEEL CONFIG -->
<CONFIG sInteraction="0" type="ECSTCONFIG"></CONFIG>

<!-- DESIGN PARAMETERS STEEL BAR -->
<CONFIG LimitUtilization="0.8" type="CCDESPARAMBARST" vSection_itemcnt="24"></CONFIG>

<!-- EUROCODE CALCULATION PARAMETERS STEEL BAR -->
<CONFIG aBucklingCurve_fx1="-1" aBucklingCurve_fx2="-1" aBucklingCurve_ltb="-1" aBucklingCurve_ltt="-1" aBucklingCurve_tf="-1" CheckResistanceOnly="1" class4Ignored="1" convergencyratio="1" fLatTorBuckGen="1" fLatTorBuckGenSpecForI="0" maxIterStep="50" plasticIgnored="0" rStep="0.5" s2ndOrder="1" type="ECCALCPARAMBARST" UseEqation6_41="0"></CONFIG>
</configs>

FEM-Design will be instructed to apply those settings and the design will reflect the parameters.

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

πŸ“ Download FEM-Design API
πŸ“° Newsletter
🌍 Documentation

Β· One min read
Marco Pellegrino

grasshopper

While preparing a webinar regarding FEM-Design API by StruSoft together with Isak Bjârhag, we have got the idea to showcase how the engineers can use our tool to optimise the selection of a cross section with the help of some grasshopper spaghetti 🍝

The outcome was really fascinating as I have never seen several interaction surface together and I have never noticed the effect of the parameters on the final capacity πŸ‘€

Visualisation is definitely a key aspect. Our eyes are not been "constructed" to understand a lot of numbers together

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

πŸ“ Download FEM-Design API
πŸ“° Newsletter
🌍 Community

Β· One min read
Marco Pellegrino

grasshopper

FEM-Design API is mostly developed to give users access to most of the model data. We believe that users should not be constrained by our idea of engineering, but they should have the freedom to manipulate the data in a way that works best for them!

FEM-Design, the main software, has a really pleasant user interface that exports all the results with good logic.

However, the API will give you the freedom to nest/manipulate the data in any way you want and export it with a small script. In the picture above, I have shown how straightforward it is to save some data to a text file.

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

πŸ“ Download FEM-Design API
πŸ“° Newsletter
🌍 Community

Β· One min read
Marco Pellegrino

grasshopper

We hope that everyone enjoyed our recent webinar and we are delighted to provide you with access to all the content!

Download the Grasshopper definitions used in the meeting from here πŸ‘‰Grasshopper Definition
Download the pdf presentation used in the meeting from here πŸ‘‰pdf presentation

Below, you can find a quick preview of what it has been discuss.

grasshopper grasshopper grasshopper grasshopper grasshopper grasshopper grasshopper

πŸ“ Download FEM-Design API
πŸ“° Newsletter
πŸ™‹ Community

Β· One min read
Marco Pellegrino

grasshopper

I recently came across an interesting case from one of our users who was trying to analyse a free-form surface.

FEM-Design is mostly use for slab and wall (both geometry are flat) but the user needs the software to calculate something different. Something that it is nowadays called "free-form"!

How can we overcome the issue?

Discretization is the key concept! What you can do, it is to subdivide the surface in several small triangles and feed FEM-Design with those.

grasshopper

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

πŸ“ Download FEM-Design API
πŸ“ Download StruSoft Trial Version
πŸ“° Newsletter
πŸ™‹ Help

Β· One min read
Marco Pellegrino

grasshopper

I want to share some insights on optimizing the direction of CLT Panel wit FEM-Design API by StruSoft. 🧐

When designing CLT panels, one of the key considerations is ensuring that the panel is placed in the right direction to enhance the slab's strength and durability.

But how can we make such models without becoming crazy? 🀯 FEM-Design API has the solution for you.

Do you think that the structure that I have shown is pure theory? πŸ™„ Have a look at Format Engineers.

PS: Have you noticed the n-gon planar panels? πŸ€“

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

πŸ“ Download FEM-Design API
πŸ“ Download StruSoft Trial Version
πŸ“° Newsletter
πŸ™‹ Help

Β· 2 min read
Marco Pellegrino
Isak BjΓΆrhag

preview

It’s time for some topology optimization! More specifically multivariable optimization of a parametric timber truss. πŸ€“

In this example I have created a timber truss with 4 variables that describe the shape of it. This is a very practical way of going about a topology optimization since you can limit the possible shapes due to production limitations to achieve an optimized structure that doesn’t look like a warped alien spaceship πŸš€ 😊

This parametrization gave approximately 100 000 different shapes which is too many to try them all (brute force). Instead, I used Grasshopper and Galapagos to utilize some machine learning to reduce the time to find an optimal solution.

Watch the video

I also utilized the design groups in the FEM-Design API so that all truss elements had the same section as well as the above and below beam. I also instructed FEM-Design to carry out an auto design of each shape to obtain viable solutions with below 100% utilization of the cross sections. I opted to optimize with regard to timber weight to minimize material, but you can create another fitness function to optimize for price, deflection, CO2 emissions or why not a combination of them all.

πŸ”₯ If you are interested in this type of workflow don’t miss our upcoming free webinar on the topic, register here: https://lnkd.in/deG2pEh3

🌟 Free trial of FEM-Design and the API: https://lnkd.in/dVMqMszZ

Watch the video πŸ‘‡

Watch the video

πŸ“ Download FEM-Design API
πŸ“ Download StruSoft Trial Version
πŸ“° Newsletter
🌟 Community
πŸ™‹ Help

Β· One min read
Marco Pellegrino

grasshopper

The father of modern triply periodic minimal surfaces (TPMS) passed away.

In the 70s, AlanSchoen was working at NASA and was always queationed about the amount of time he was spending playing with soap and water. He lived to see his work expanding in every direction possible.

You can download the Grasshopper definition used in this tutorial from here πŸ‘‰Grasshopper Definition

πŸ“ Download FEM-Design API
πŸ“ Download StruSoft Trial Version
πŸ“° Newsletter
πŸ™‹ Help