PropertySet2Excel

Hi, I have a question regarding exporting properties sets to an excel sheet. However, when I take property values, the values come in the wrong order. The names also came in the wrong order, but I used the “List.Sort” node to sort them, but the values that should be connected with the names come unordered. Any tips to solve this problem? Here is a screenshot of the problem:

Welcome to the forum Debora! I’d suggest not worrying too much about sorting the property names if this is to get to excel. More likely, the entire dataset will be sorted by the civil object name anyways. If you are trying to do property set data dump, below is a script I did a while ago that gets all objects that have a particular property set definition with a one of the property values greater than 0, then it looks at all the properties and values and exports to excel. Hope this helps!

Property Set Values-Output to Excel v1 (all).dyn (73.4 KB)

You can use SortByKey to sort a list of items based on the values of another list. You don’t even have to sort your Parameter names separately this way since it sorts the list of items and the keys.

1 Like

Hi!!

I tested your code based on my file, some nodes worked and the spreadsheet export did as well. However, the spreadsheet did not present all the information. Some fields were null and two nodes had the error “Warning: Internal error, please report: Dereferencing a non-pointer”.

Below is a screenshot of the worksheet and the code.

I had already tested these knots. I tested it again as you suggested, but it didn’t work either. What I really want is to export a spreadsheet with the properties exactly as shown in the print below. I want to do this for all alignments at once.

properties

If I could relate the names to their respective values, it would help, but I can’t find a node for that.

That’s what SortByKey should do. Connect Property.Name into the Keys input and Property.Value into the List input. Because you have sublists, you’ll need to set both inputs to use list levels @L2. Post a screenshot if that still doesn’t work for you.

The script will need a little modification, I believe I made this with having only one property set definition being used, whereas you have 3.

I updated my script a bit to account for multiple PSDs and the sorting advice from @Nick_Boyts worked a treat. I’m not sure how you’d want to incorporate the name of the PSD itself, but one way would be to concatenate the PSD and the property names but below is what I’ve done thus far. Hope this helps and let me know if this worked for you.

Property Set Values-Output to Excel v2 (all).dyn (85.7 KB)
property sets different types (multiple psd).dwg (1.0 MB)


image

4 Likes

Hi Kirk!! Thank you. Your script worked, I adapted it to my file and it worked!

I’m still new to Dynamo, and your help was very important to me!! :hugs: :blush:

1 Like