Grasshopper link Tekla - C# script for Bolted parts

Hello! Is it possible to create a script in C# for bolted parts to use it in grasshopper Tekla live link? I am a beginner and I don’t really know how to approach this issue. Thanks in advance for any replies! :slight_smile:
image

Hello. What do You exactly need? You want exchange bolted parts or indicate new parts?

I would like to create a Grasshopper component to use with the Tekla Live Link. In my model, I have many bolts that are not connected to nearby plates — although those plates are easy to select. Unfortunately, the ‘Bolted Parts’ functionality that exists in Tekla is not currently exposed as a component in the Tekla Live Link :frowning: I need component that has input: 1) bolt; 2) first part 3) secend part and output: connected → true/false

Here is my C# script (for Tekla 2024) with the functionality you need. Please give it a try. If you have any questions, feel free to contact me. I believe this could eventually become part of the Tekla Live Link component.

0_exchange_bolt_parts_new.gh (18.0 KB)

Script Behavior Table:

Input Conditions Script Action
old = valid, new = valid, auto = false Replaces oldPart with newPart in all fields: ToBoltTo, ToBeBolted, OtherPartsToBolt.
old = ""/0/empty, new = valid, auto = false Adds newPart to OtherPartsToBolt if it is not already assigned.
auto = true, autoGuids provided For each bolt group:
• Calculates the bolt line (Start → End)
• For each autoGuid:
→ If the part intersects the bolt line and is not yet assigned
→ Adds it to OtherPartsToBolt
old = valid, new = valid, auto = true, new in autoGuids Replaces oldnew, then attempts to add new in auto mode, but avoids duplication.

Thank you for sharing! :slightly_smiling_face: It’s almost working as expected. However, in the new parts, I need both the 1st and 2nd part to be included. Your script seems to be replacing one plate with the other. Would it be possible to add the 2nd plate to the 1st one instead of replacing it?

In my script, you have several options. Please refer to the second one:

  • The “oldPartGuidStrs” input must be either an empty string (""), "0", or left empty.
  • The “newPartGuidStrs” input is used to specify the part to which new elements will be connected (with auto = false).

The script automatically gathers all items that are bolt-connected to the specified part and then adds a new item connected to newPartGuidStrs.

Alternatively, you can disconnect both the oldPartGuidStr and newPartGuidStr, set auto = true, and provide a list of parts to be connected via bolts using the autoGuids input. All parts included in autoGuids will be connected together.

it is work perfectly! I just connected merged plates to autoguids :slight_smile: Thank you!

Here is a script with comments in English (not Polish) – add new parts to the connection. :slightly_smiling_face:

0_exchange_bolt_parts_new_EN.gh (17.6 KB)

If I have not misunderstood, you can use the default tools in the GH link, see below.

Hi Oskar,
KrisCze encountered an issue where, in some cases, bolts were only connecting to one part instead of both. In Tekla, there’s an option to recalculate and potentially add a second connection part. However, this functionality is not available in GH link, which is why we implemented a custom C# script.
On your screen, you’re only visualizing which parts are currently connected by the bolts, correct? Or is it possible to use this components to add new connection partners as well?

1 Like

Got ya, not sure if it’s possible to do what you described with the GH link components so C# might be the best solution.