I have made a simple script that writes some data to a specific UDA I have created.
As it is now I use a filter to mark all steel beams in my model and then get the property weight and then multiply that with a simple number. Works fine but I can see the limitations. Se script below
What I want to do is to mark, lets say all steel beams and steel columns, get all their individual weights and then mapp the material they have to a excel list where I then want to “collect” a value. When that is done I then take that value and multiply it by the part weight to get the result and write to my UDA. So my question is how that can be done in grassphopper?
So for example the material “S355J2” has the value 3.15 meanwhile “S235J2” has the value 2.75.
I want those values to be presented in grasshopper somehow and then use those to multiply with the correct steel beam to get the result. I hope that is understandable.
I have seen some one using this box. What is that?
check out the AutoConnect Demo Definition in Warehouse:
The bottom part of the definition can take a profile value as input and select attribute values (“nw2” and “rw2”) from the correct row in an excel file depending on the profile, which sounds similar to what you’re trying to do.
So the package contains an Excel file with the following content:
In the definition, we first parse the excel file and get two tables - one with the key values (profiles in the example, would be the material in your case) and one with the attributes (your number value).
Then the next component/cluster selects the appropriate row from the attribute table based on the input value from the beam (i.e the profile in the example).
This hopefully gives you an idea of how to implement something similar for your case. To parse the excel file I’d use components from the LunchBox plugin nowadays.
It doesnt necessary need to be a excel-list I collect the data from. Its better if I can create a list in grasshopper for know I think. So can I somehow based on the material of my beams get another value basically? S355J2 corresponds to 3.15 and S235 corresponds to 2.7.
Is this more understanable maybe? (not my code, just explains what I want to do)
I might have read this wrong but wouldn’t the below solve your problem? List A contains all your available materials, List B all your corresponding CO2 values, then use the Key Value Search component to map the values, multiply by the weight and then write to the members in TS as UDA