# Import Propertyset data from CSV/Excel

**URL:** <https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626>\
**Category:** Civil 3D\
**Tags:** excel, dynamo, csv\
**Created:** [November 26, 2019, 9:13am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626 "2019-11-26T09:13:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 26, 2019, 9:13am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/1 "2019-11-26T09:13:41Z")

</div>

Hello everyone,

I’m trying to make a link with my Civil3D 3DSolids and a .csv file. The idea is that a project manager of sorts can fill in the csv file when changes occur I only have to select one of the objects and the .csv file that has been filled in. I’ve seen the webinar about this but can’t really make any sense of it so I can use it.

I want the .csv file to look orderly. On the left are the PropertyNames and on the right are the PropertyValues that have to be filled in manually.

I tried making it work myself (see image below) but i’m not getting far… mostly because my lack of knowledge around scripting and dynamo.

 ![CSV naar PropertySet_V1_2019-11-26_09-46-40](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/8/88824189d5d18fa422ae0066313966d9828bbe0a.png)

So i’m wondering if someone can help me work this out.

(sorry for the lack of images but I can only upload 1 image because I’m a new user…)  
Thank you in advance!

Bas

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 26, 2019, 11:15am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/2 "2019-11-26T11:15:33Z")

</div>

Hi,  
you need to seperate your data from the \*.csv into two lists.

1. property Names
2. property Values

Maybe you can use the node “Get item at index” and use the levels.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/5/95bbb5f30304cf1337fff0ed5c57a7acf5934c58.png)

And pls show the csv.  
Maybe we can set up the csv different and avoid some problems.

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 26, 2019, 12:31pm UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/3 "2019-11-26T12:31:45Z")

</div>

I will try the get item at index method. That will probably go a long way already!  
Currently the .csv file looks like this:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/4/1432b43d8f831f96c6bc169d3a1108b98c2bf1e3.png)

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 26, 2019, 1:16pm UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/4 "2019-11-26T13:16:27Z")

</div>

Hi,  
i never used csv before…but now i know -\> don’t use it, use xlsx  
You have more work with csv.  
You can load a xlsx file and select the data like that:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/f/8fea5b2fb413ad5cb7c479f37b2c902621629f38.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/d/7d439f7ca40d6297533d559dd1a7fc28ca4e70e6.png)

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 27, 2019, 11:30am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/5 "2019-11-27T11:30:02Z")

</div>

Thank you for helping me out! The things you recommended work perfectly.

But I think I’ve found a major problem… I want the script to update the propertysets of 3D Solids. But I think you can only select objects…

When running the script I get a warning for the object.

 ![CSV naar PropertySet_V1_2019-11-26_09-46-40](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/6/d687a814bc94e99d20efef2b64a6c295f2cea31c.png)

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 28, 2019, 7:35am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/6 "2019-11-28T07:35:08Z")

</div>

What does the error say?  
This works for me:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/d/1da09163a20c4ab322de8e9793ffcf015a57d55b.png)

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 28, 2019, 9:35am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/7 "2019-11-28T09:35:24Z")

</div>

The error I get is as you see in the image below. I get a null when trying to select all objects in that layer. It looks like it doesn’t recognise 3D Solids as an object.

 ![Error Null](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/6/56371010d197da2cad2ee0d46702aa4d81a12d22.png)

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 28, 2019, 9:38am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/8 "2019-11-28T09:38:03Z")

</div>

When using the method you use here, but a little bit different because I want to get all the information automated out of the excel file, I also get an error message:

 ![Error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/a/eab12b958d3a94171ef329767bd3b4c6d36e622b.png)  
Is this error because I don’t manually give the information in my dynamofile?

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 29, 2019, 7:02am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/9 "2019-11-29T07:02:57Z")

</div>

The property set value needs to be a string not a double.  
There is a node for this: “String from Object”. Put this between the codeblock and Property.SetValue.  
And pls show every output of your nodes.

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 29, 2019, 8:14am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/10 "2019-11-29T08:14:34Z")

</div>

Using the “String from Object” solves one error message. But the output from propertybyname is null. I think this causes the error message.

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

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 29, 2019, 8:41am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/11 "2019-11-29T08:41:55Z")

</div>

These are not names of “parameters” in your property set:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/0/d0c1b39e8e7ae4896a8b6bec59ffc32a14af64fb.png)  
or you name your parameters “1”, “2”…but than you need to trim your string from “1.000” to “1”.  
Pls show the property set in Civil 3D.

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 29, 2019, 8:43am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/12 "2019-11-29T08:43:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 29, 2019, 8:46am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/13 "2019-11-29T08:46:49Z")

</div>

you can split your strings like that:

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

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 29, 2019, 8:54am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/14 "2019-11-29T08:54:48Z")

</div>

That works to get the name right, but not for the value. The value is empty in the PropertySet.PropertyByName, but i can’t add the value in that node. Butt the Property.SetValue shows null in the list.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/5/059a5d4ed0dba0032190a471362347d78ac3bc97.png)

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 29, 2019, 9:03am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/15 "2019-11-29T09:03:41Z")

</div>

Mh…could you pls restart your Civil?

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 29, 2019, 9:11am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/16 "2019-11-29T09:11:32Z")

</div>

It works! But I can only select one object at the time using the select object node. When I try to get all objects (3D Solids) in the layer I get a null output. Does Dynamo not recognise Solids as an object yet in this node? Because this would be my next step to making the proces faster.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/2/1234e643797c83912545223cc19ddd6353a8137b.png)

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 29, 2019, 9:24am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/17 "2019-11-29T09:24:55Z")

</div>

There are more than one way to get your objects:  
Here is one:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/4/14a24f588d8ab1953133c559483c07edfa4cce12.png)

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [November 29, 2019, 9:43am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/18 "2019-11-29T09:43:33Z")

</div>

I’ve made it work to select all the solids in the layer. But now it doesnt update all the info in the propertysets… It does one value per set (see image)

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

---

<div class="post-metadata">

**Author:** ![Fiesta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fiesta/32/31914_2.png) [@Fiesta](https://forum.dynamobim.com/u/Fiesta)\
**Post date:** [November 29, 2019, 12:53pm UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/19 "2019-11-29T12:53:46Z")

</div>

You can do it like that:

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

---

<div class="post-metadata">

**Author:** ![Bassfreeze](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bassfreeze/32/85756_2.png) [@Bassfreeze](https://forum.dynamobim.com/u/Bassfreeze)\
**Post date:** [December 4, 2019, 7:02am UTC](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626/20 "2019-12-04T07:02:11Z")

</div>

That would work if I manually enter the names of the property’s. But I want the script to also get the names of the propertys automatically from excel file. Using this method I would need different inputs for the name and the value will be filled in at index.

 ![20191204 Error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/7/c77ae9de03ff22f8f86c3b9b6bf65fa287648037.png) [Propertyset V1.dyn](https://forum.dynamobim.com/uploads/short-url/x2x6o7Wp0tRAdfk9WXSCIAWRJf9.dyn) (59.0 KB)

[Next page](https://forum.dynamobim.com/t/import-propertyset-data-from-csv-excel/43626.md?page=2)
