Set Parameter values from Excel based on Family and type name

revit
dynamo
familyinstance

#1

Hi All,

I am new to Dynamo, Im trying to write a Script that does the following:

There are a few Parameters present on all the RFA’s like Assembly Code, and other text based Parameters. I want to be able to read this data from an excel file and apply to all RFA’s loaded in the model(even if its not placed anywhere in 3D). Currently finding solutions online which show some system nodes which im not able to find. Any help would be much appreciated.

Regards,
Atul


#2

we have nodes to get data from excel.

as well as we can set the parameter values to the particular element.

use nodes 1.READ FROM EXCEL.
2.SET PARAMETER BY NAME.


#3

hi, I have used these nodes, i need it to read the Family and Type name from the excel and use a directory look up type of function. Its this part that im struggling with


#4

The lookup part is called a dictionary in Dynamo, maybe it helps you find the node


#5

Try and show your work:)


#6
FAMILY TYPE ASSEMBLY CODE eDesign Non Default eDesign Customizable
1050_LIBRARY_UNIT_CT HR_WE PKR1466 Y N
1050_LIBRARY_UNIT_CT HR_WA PKR1477 N N
1050_LIBRARY_UNIT_CT HR_WL PKR1478 Y Y
1050_LIBRARY_UNIT_CT HR_TK PKR1499 Y N
1200_TV_UNIT_CT HR_WE WER1577 N N
1200_TV_UNIT_CT HR_WA WER1588 N Y
1200_TV_UNIT_CT HR_WL WER1589 Y N
1200_TV_UNIT_CT HR_TK WER1233 Y Y

this is a sample of the excel file. The first column is the family name. The second column is the type names under each family. The RFA’s have been made and loaded into the model. The 3, 4 and 5th columns are parameters which need to be filed in.


#7

we need the dynamo file too


#8

Family Name and Type.dyn (23.3 KB)

Hey. This is what i have so far. Trying to list out all the families and their types. I am able to create an excel out of it. Now i have reverse the process and use the set parameter value by name node i guess. But im not able to figure that part out.


#9

I couldn’t open your file, but you can, as @m.rijsmus pointed out, use dictionary (dictionary.CreateDictionary) to relate each key, for example your family type with each value. This part can be a bit tricky, because your are exporting family and type, and you need to be able to retrieve this information back or format your key in a way that you have an unique key for each element. If I have understood him, you would need 3 dictionaries, one for each column.


#10

So this is what i have as of now. the Script is to able a default value of “error” to all the family types. But it is not able to read the family and types names and correlate it to the families in the model. hence everything is getting the default value of error. I dont know if this is helping to shed some light on the problem.

i feel the issue is with the way i am trying to read the name of the family and type from the excel. that is not set up correctly.


#11


Hey all,

Thanks for all your help. I got it working. Sharing the solution.

Cheers! :slight_smile:


#12

Nice work!

Could you please share the file? :grinning:

Cheers!


#13

Hey,

PFA the file. Hope it helps. Cheers.

Set Type parameters for RFA from Excel.dyn (53.4 KB)


#14

Excellent! thanks a lot :grinning: