Excel to Grasshopper to Tekla Structures to Excel (via Python)

I am both new to Grasshopper and Python but I am working on a rather complex set of steps: I am looking to pull data from a specific sheet of an excel workbook, and have it update a grasshopper instance (long term probably develop it into a component for Tekla Structures) and then have it update a Tekla structures model when the workbook is updated. Ideally I would also want to back-feed the Tekla data into said workbook if the modeled objects get updated in Tekla as well.

As of writing this, I have been able to pull data from the workbook sheet I want, explode a data tree into the different pieces and then manually assign each piece to a Tekla object in grasshopper and have it create said object in the Tekla model. As you can imagine this is not realistic to do this for hundreds or thousands of objects as I will ultimately need to be able to do. The more I have dug into it, I am thinking using Rhino 8 with ability to utilize python 3 scripts will be the most efficient way to automate this using something like openpyxl.

Currently I am working on the back feeding process and getting stuck on how to pull the start and end coordinates of a beam, plate, etc. out of Tekla. Any and all suggestions or help on this part or the whole process would be greatly appreciated!

Hi Nick,

I would recommend using the Lunchbox plugin for grasshopper to read from Excel files but your solution with python might be faster, worth a speed comparison.

Go to Rhino–>Tools–>Package Manager–> Search for Lunchbox and then click install

image

Not sure what you mean by exploding data tree, usually that’s not what you want to do but it’s very hard to paint a picture of your workflow without an example GH file. You should be able to do what you want without python coding, You could possibly make it more efficient with python later down the line however.

/Oskar

Hi Oskar,

I have been testing out both the Lunchbox and TTToolbox excel plugins to import/export in Grasshopper. Attached to this are a sample csv and a copy of the .gh I have been using to try to proof-of-concept what I’ve been trying to do. Thanks!

Nick

example 3.1.1.gh (34.2 KB)
PS-5303 20240404_15_16.csv (3.5 KB)

Hi Nick,

I’m not sure how your file is going to look for eventually but here’s a more dynamic way of listing your values from the .csv.

I’m searching for the header that I want to retrieve instead of plugging in an index. Probably better ways but it all depends on how your file will look like and how you want to separate each category.

I would also recommend modelling closer to 0,0,0 in Tekla and then setting up a Project Base Point to get the correct coordinates when you later export back to wherever the data is going.

image

Better to use a known point to plug into A rather then what I have done, but you get the gist.

Hope this helps!

Oskar,

Would you be able to post your GH for me to reference directly? I am still very new to GH and still learning all the different icons and tools. Additionally, could you provide some guidance for pulling coordinate points out of Tekla into GH? I have not yet found a way to export that portion of Tekla data.

Thanks for all your help so far!
Nick