Very new to Dynamo, so please bear with me.
I’ve spent a few days trying to complete a task, but all I got so far is import categories and elements and read out the values.
I have a list of rooms (5000+), one column has some parameters, one column has some values. I want to summarize this list based on the parameters while adding up the values. (blank value will be treated as zero). Then I have a list of doors (1000+), and I want to add the summarized value from the room list into the door list based on the same parameter. (in this case, if door has a parameter D, it gets a blank input).
I think I get the question, but in your example Room#1 has a parameter of A, but a value of 0, while room #2 has a parameter of A, and a value of 1. Is the intent to match the values of all the A’s to 1, B’s to 2, etc?
–input “A” into room #1, #2 parameter column (done manually in Revit)
–leave value column of room #1 blank, input the number 2 into value column of room #2 (done manually in Revit)
–add values together whenever parameter reads the same: so for A, blank+2=2. return A, 2. (Done by dynamo)
–write the number 2 into the corresponding parameter A row of door #1 (Done by dynamo, probably use the setParameterByName node? but I only see the name of column you want to write the values, I don’t know how you can write values based on another column’s sorting order)
If anyone used ArcMap, you’ll know the summarize table function where it can delete repeated value in one column, so each row is unique, while at the same time sum up values in another column, so I can then join it with other tables based on the same unique parameter.
This is kind of what I’m trying to do.
In your example you only show one parameter per room. Does Room 1 have parameters A, B, C? Or is it something like each room has a parameter “Type” with a value of A, B, or C and a numerical value that goes along with it?
it’s the second half of your paragraph that I’m aiming at:
“something like each room has a parameter “Type” with a value of A, B, or C and a numerical value that goes along with it”
Anyhow, I think I figured it out. the List.GroupByKey solved it.
Maybe I did it in more step than necessary but I tested it a few times with the example below and I got the results needed.