Assign calculated values to created shared parameters in Revit

Hello everyone,
I am trying to write this dynamo code to automate the Life Cycle Assessment in a BIM model. So far I have managed to create a list of shared parameters in Revit (LCA environmental impact parameters), link the Excel file (LCA database) with the Dynamo and get the impact parameter values, extract the required material quantities and perform the LCA calculations for the selected material. What I want to do now is to assign the calculated values back to the shared parameters that I created. Can someone help me with that?

Hi @oriss,

it would be more helpful if you provide a sample revit and excel file.
thanks,

-biboy

LCA list of parameters.dyn (192.3 KB)

OBD_2020_II_OB - Copy.xlsx (2.7 MB)

Is the element ID here is the element ID of the wall under analysis?

A

Yes it is the element ID of the wall under analysis to which I want to assign as value the material ID obtained by the LCA database (excel file) material ID from database

Thank you for your help!

Can you help me, so the LCA parameters in the excel file is just a guide and not automatically populated? I mean there is no way to know the element ID of the wall where to input the calculated values?

The calculated values are assigned to all the walls that are using the same material. The value is calculated for all the volume of the material that is being used (equal to the volume of the walls to which the material is used) the Element ID is the same as the Material ID.

I see, I am almost finished with my script (although needs cleaning), lastly, where to find the value for the LCA Category?

The “LCA parameters” in excel is just a list I created in order to import in Dynamo and create the shared parameters for the elements I am going to use in Revit (walls for example)
No, it is not automatically populated
The sheet “LCA results” is automatically populated by the dynamo calculations

OK thanks. I think I can finish the script today, or mabe someone else will finish it before me. :slight_smile: Please wait a sec.

Thank you so much for helping me :slight_smile:

Hi,

I am just adding the finishing touches to the dynamo script, I just want to clarify, since you made the Element ID a type parameter, you want input the wall type id? or you want to input the wall instance id, in that case you should make Element ID an instance parameter? just a clarification.

-Biboy

Hi,

I made 2 dynamo files. One is for when you make the Element ID a type parameter and one is when you make it an instance parameter. The difference is that when you make it a type parameter, the family type id of the wall will be inputted to the parameter and when you make it an instance parameter, the instance id of that wall will be inputted.

LCA list of parameters (Walls Types).dyn (45.1 KB)
LCA list of parameters (Walls).dyn (45.2 KB)

-Biboy

Hi,
thank you for solving this. I want to make it a type parameter. I tested the script but is seems that is has a little problem when running. I writes the values to only three of the parameters from the shared parameters in Revit.

Hi,

Can you send me the revit file? I think I named the parameter correctly.
If you open the python code (the node with error) you will see at the end the list of paramters.
you can check there if your parameters match with mine.

Also if you make it type parameter, the wall type ID will be inputted not the wall instance/element id.

I got it. Please rename your GWP variable without the “space” in the parameter name, “GWP” not “GWP_”. Or open my Python script and rename my parameter with space. Like the following
c d

Hi, I can not upload here because the file is heavier than the site allows me. Is it possible to send by email?