Item with Same Key Has Already Been Added - gfa Units

I’m working on a Dynamo graph that automates the placement of multiple buildings on a site in Forma. Right now, I’m having issues pushing my geometry back to Forma as the gfaUnits, or unitcomponents. Using my previous generative chaos tower workflow, I copied over the UnitComponent and MeshRepresentation nodes (which were updated), those are joined into a list and fed into GenericElement.ByRepresentation.

This node is where I’m having the issue. “Item with the same key has already been added. Key: gfaUnits”. I have deleted and added the node back, tried importing the graph into a new workspace, restarting, etc. Nothing has worked. Haven’t found much information on this issue specific to the Forma nodes. Odd thing is, when I run my generative chaos tower workflow, it generates just fine. I get all of my geometry in Forma, as the gfaUnits.

hi @Aaron_Coffman2 can you share a.dyn here (or dm) and some mock input data so we can try to reproduce it? (you could try the remember.data node) Another option could be to share a sample project with us.

Hey @Michael_Kirschner2, file shared. Thanks!

Hi Aaron, I hope you are all well! :slight_smile:

Cool to see new experiments on the building nodes.

So you need to inspect the data going into the node for ByRepresentations.

I’m no Dynamo expert, and I’ve upgraded my mac so I’ve yet to install Windows now which prevents me from testing or setting up a sample for you. But there is data flow into that node which tries to invoke the ByRepresentation node with the gfaUnits reprepsentation twice on the same ‘item’. So in plain speak your trying to create an element (e.g. Buildings) and specifying the same representation (gfaUnits) twice for the same building. This is prevented at the Node and API layer, and that is the error you see. So this is either a Lacing issue (:melting_face:), or a deeper array matching issue in your graph dataflow (:fire::fire_engine:) .

Hope this helps :slight_smile:

Hey @havardh, thanks for responding!

I did inspect the GenericElement.ByRepresentations node and the inputs are the same. From my previous tower model I copied the Forma nodes and logic. If I switch the order of the List.Create node, then I get an error “An item with the same key has already been added. Key: volumemesh. Something in my order is messed up, I just can’t find it!

@havardh - I also tried playing with the list, creating one solid for each building. Did not work either.

Edit to my post above. So I closed out of Dynamo (which I have done 100 times before) and reopened my workflow. After running it again I was surprised to see that each level module was generated in Forma, for each building. Still getting the same error.

Worked with Aaron on this, we transposed the list of meshes and component representations to get the buildings to come in with floor plates correctly. Here’s a screenshot of our solution for anyone else experiencing the same issue.

I’m fortunate enough to work with @patrick_podeyn, who came to the rescue once again. I spent more time than I care to admit messing with the lists when all it needed was the transpose first. Buildings are coming in with reportable metrics! One issue I did notice is that I need to activate the 3d sketch mode for each mass in order for the individual levels and colors to appears. The information is there; it just needs the action of opening each building in order to populate it.