Assigning list values to another list with index number

I am trying to assign list values to another list basically. But couldnt figure it out how to implement my code into Dynamo.
For example I am retrieving my #1 List from database and want to write these values to #2 List which is already in the Revit data. In short, I want to update these Revit values ( list #2 ) according to data from my Database ( list #1 ).

In the screen shot below I want to be my #1 List[ 0 ][ 0 ] value to be the new value on #2 List[ 0 ][ 0 ],

The problem is these list values could be hundreds so I have to implement a loop system. And I am stucked here.

What is common across the 2 lists ?

You probably can’t assume that they are in the same order ?
i.e. is the third item in list #1 always the same as the third item in list#2

Andrew

Could you give a concrete example of what the list beforehand will look like and what the list afterwards should look like?
Because I don’t understand how and on what basis you want to combine them.

My Revit values are these:
revitdata

Acquired these values through Dyanmo ( Except the first column, its not needed. ) :
revit

And the list of the values that I want to insert to Revit
sqldata

So my aim is to make List #2’s [0] “1B-A-K03” into the value of List #1’s [0] “Mahal-1” and so on.

Another example.
I have 198 data in my Revit and also I have same amount of data in my database. But I want to insert my database values into the Revit. All of these 198 data has exactly same number of columns. But doing it by hand would be very long instead of it for loop could solve my issue I think. But couldnt figure it out

use SetParameterByName if they have same order … take the element from revit ,enter parameter name, then the value from your new list

But I have 198 different row in my data and this would mean 198 different SetParameterByName

no you have’nt, dynamo can read that from one node , just enter the list from 198 element, and the value list from 198 element , just be sure it have the same order,

1 Like

Could you give me an example I am a bit of confused with what you meant with “just enter the list from 198 element” :slight_smile:

They always in the same order. I created my database according to Revit Columns

sth like this:

1 Like

Are you just trying to replace the value in the list for like a scheduling purpose or do you want to change the parameter on an actual element? Changing just the list is easier to do and would just be a simple replace graph. I can give you an example in a bit.

Here:

Note the list levels on a few of the nodes, some @L2 and one at @L1.

thanks, this is the one that I was looking for!

1 Like

Hello kennyb6,

Where have you get the node “list.replaceItemAtIndex” from?

It looks like an out of the box node but i cant find it…

Many thanks,
Jongon

That is an OOTB node. You may have to check what you’re searching for, the default search function is a bit fussy.

Thanks Hamish!

I finally found it, but indeed the search function it s helpless!