# Comparing Parameter Values between different Files

**URL:** <https://forum.dynamobim.com/t/comparing-parameter-values-between-different-files/43493>\
**Category:** Revit\
**Created:** [November 22, 2019, 11:50am UTC](https://forum.dynamobim.com/t/comparing-parameter-values-between-different-files/43493 "2019-11-22T11:50:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipp\_lammers](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/philipp_lammers/32/51209_2.png) [@philipp\_lammers](https://forum.dynamobim.com/u/philipp_lammers)\
**Post date:** [November 22, 2019, 11:50am UTC](https://forum.dynamobim.com/t/comparing-parameter-values-between-different-files/43493/1 "2019-11-22T11:50:25Z")

</div>

We are trying to compare two Revit files. The first file is a an old survey model in which some elements were set to be demolished in the Construction Phase. Some elements were also split. The second file is a newer version of the above file and we would like to transfer the “Phase Demolished” value to the same elements (ID) (though not direct, but as a note into a custom parameter). At the same time we thought to run a comparison between the Bounding Box of each of these elements in the old file vs. the new file. If a Bounding Box has changed we would like to write a comment into yet another custom parameter.

We have managed to extract Element ID, Phase Demolished and Bounding Box into an Excel table and read that data in a new Dynamo Script. This new Script is also finding the same values for all elements in the new file.

We are now struggling to compare the two sets of lists. I have tried “List.SetDifference” with “List.IndexOf”, but it doesn’t work as I expected.  
The plan was to retain only those elements from the current model file that are also in the list of elements from the excel file.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/9/e99d724a238f3d08ef08643523bd89fd4ebd362a.png)

I would like to know if what I am trying is actually the right approach, or if there is a better one. Once I get past this hurdle, my next challenges would be the following steps. Maybe you have some tips there as well.

_The next step would have been to write the value from the excel file for each matching Element ID from the “Demolished” list into the custom parameter “Transfer - Phase”._

_After comparing the strings from each elements Bounding Box I would have liked a True/Fase value in the custom parameter “Transfer - Bounding Box Check” for whether the strings are identical or not._

I have attached the files used.  
[data.xlsx](https://forum.dynamobim.com/uploads/short-url/5ICCaPE82OuzEtzsvJHLXoQPlXj.xlsx) (139.3 KB)  
[Tools - Write Demolition Status for Forum.dyn](https://forum.dynamobim.com/uploads/short-url/sro8q8iYMl0SMBqTjnNuYw2gy6z.dyn) (76.6 KB)  
[Tools - Extract Demolition Status for Forum.dyn](https://forum.dynamobim.com/uploads/short-url/7NHSWXVYw7yEKevNoOeljgnklt1.dyn) (50.2 KB)

Thanks a lot in advance.

---

<div class="post-metadata">

**Author:** ![cgartland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cgartland/32/45378_2.png) [@cgartland](https://forum.dynamobim.com/u/cgartland)\
**Post date:** [November 22, 2019, 3:03pm UTC](https://forum.dynamobim.com/t/comparing-parameter-values-between-different-files/43493/2 "2019-11-22T15:03:00Z")

</div>

The element ids from Excel are being interpreted as `doubles` whereas the ids from the model are `integers`.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/b/abb31ffbd7a2e6144f3f264f28d5d5f728a452cf.png)

You can use a node like Math.Floor to convert the doubles to integers. Once you have both lists of integers, you can use a List.SetIntersection to only return ids present in both lists.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/4/f430902fe0b8e5c48c5434c4ee4e998246ca03f1.png)

You can take this a step further to then use the resulting element ids to get the actual elements (in the example below I am just using a string as a placeholder for actual elements):

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/9/79805fd312ad067416fa98840cd09e55a3f4b7bb.png)  
[Tools - Write Demolition Status for Forum.dyn](https://forum.dynamobim.com/uploads/short-url/uemMcFvhDHNCHlSTwsR0EplINYD.dyn) (45.3 KB)

---

<div class="post-metadata">

**Author:** ![philipp\_lammers](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/philipp_lammers/32/51209_2.png) [@philipp\_lammers](https://forum.dynamobim.com/u/philipp_lammers)\
**Post date:** [November 25, 2019, 3:48pm UTC](https://forum.dynamobim.com/t/comparing-parameter-values-between-different-files/43493/3 "2019-11-25T15:48:42Z")

</div>

@cgartland hanks a lot for the quick and detailed help. That did the trick (rounding down to convert from numbers to integers). Script is working now. Much appreciated.
