Apply the same parameter value into two lists based on elements with matching parameter values

Hello!

I’m still learning Dynamo and I’ve run into something unknown, so I’d be very gratefull if anyone could shed some light here:

I’d like to get the parameter value from one group of elements (from one category) and apply it to another group of elements (from another category). Both groups wil share the same parameter. But, I need to apply these values based on the elements of the second group matching another parameter’s value from the elements of the first group.

Explained in another way, I need to read the Electrical Circuits’ “Wire Size” parameter value and apply it into the Conduits “Wire in Conduit” parameter, based on the Conduits and Electrical Circuits with a matching value of their “Circuit ID” parameter.

And since I’m not sure I explained it very well in english (not my native language), I made this diagram:

I hope this is possible, because I really have no idea of how to do this, I can get the values from the parameters in separated lists, but I don’t know how to apply the values from one list into another, specially if both lists have a differing number of elements.

Thank you!

@eurzaiz87 You could use dictionaries

Hi @salvatoredragotta, could you please give me the name of the package you’re using? I’ve tried searching for dictionaries but I haven’t found anything with those nodes.

@eurzaiz87 OOTB nodes in Dynamo 2.0.2

@salvatoredragotta I’m using version 1.3.3.4111 for Revit 2018.3, we can’t change this projects version due to interoperability issues :grimacing:

EDIT: @salvatoredragotta: I was wrong, I’ve just moved into Dynamo 2.0.2, it had an issue with Revit 2018 and didn’t seem to work but I managed to find a solution (link if anyone has the same issue: https://github.com/DynamoDS/DynamoRevit/issues/1968); I’m gonna try your solution.

@salvatoredragotta:

I’ve tried your idea but I’ve got some errors, I’m posting the script as it is now (note that the set parameter node is the one I’ll adjust at the end to apply the values we get from the dictionary).


I hope you can point out the error…
Thanks

1 Like

@eurzaiz87 What do the errors say?

@salvatoredragotta:
Of course:

1 Like

@eurzaiz87 You cannot have duplicates keys in the dictionary. Filter your data with unique items before creating the dictionary.

@salvatoredragotta:
You’re right, I think I’ve fixed it, it works now! Here’s the final script:

Thank you so much!!!

1 Like