Excel-Import - right assignment of different family parameters in a category

Hey guys,

I am new with dynamo and I want to import measured data from excel to the right elements in Revit.
The data is imported in Revit, but not to the right elements.
It always worked when I set an own indicator “1” and so on to the elements in revit, afterwards I imported the measured data and Revit set the first data from excel to the element with indicator “1” and so on. There I only had one family in a category.
But now I have a few families in one category and I want to import my Excel data to the right elements. How can I do that? Revit doesnt set the data from column 1 to the element with indicator “1”, it sets the data from column 1 to ascending family numbers.
Do you know how can I manage, that my excel data is set to the right family in a category?
thank you!!

You need to sort your excel data, your revit elements or both excel and revit to get them to match. What information do you have in excel and what information do you have in revit?

I have already sorted my excel data in excel, whats my measuring data for all concrete covers.
I only want to set the 25%-Quartile to my attributes (concrete cover north side,…) in Revit.
In the end, with the element.setparameterbyname node I get all the North measuring data in a list, but not set to the elements with own given “marks” (1,2,3,…), instead of that it sorts my data to ascending family type ID numbers…

Ok so based on what you have given here you are trying to apply Column 1 North with a 25%-Q… of “28”

What is Column 1 in Revit? How is it Different then Column 2? Have you given then some sort of unique caricaturist so you can sort them to match the list from excel? If the Columns in Revit are named Column 1, 2, 3…then just get the name of the Columns and sort by key.

The key would be Columns name and the list to be sorted would be the elements. If the names are not this you will have to figure out something else in the Columns to sort by.

yes I have given them a mark in the instance properties. Is it possible that I sort them by key by an attribute of the instance properties? then it would be very easy and fast :smile:

I am a little bit further on now :grin:
when I want to sort my list (node element.getparametervaluebyname), I am not able to get the list in an ascending order. If I choose SortIndexbyValue the program always says the node cant work with type array. If I choose Sort I dont get the ascending order, that means I want that in the list is list index 0=1 and so on.
Does anybody know how I get an ordered list after the node getparametervaluebyname?
Do I have to make another key?
thank you

Plug the elements coming out of All elements of Category into the list and Parameter Value into Keys.

It will sort your list of elements buy the parameter you gave it.Then you can apply the value from excel.

@l.zindat Did this work for you? If it did please provide a description and mark a solution. This way it can help other who a looking to do the same thing.

Sorry for the late response!
Thank you for your advice! It worked almost, but there´s the problem @erfajo mentioned! It is sorting in the alphabetical order and not in the natural oder!

Thank you! Your node should be solve the problem!
If I load your dynamo file, it says that the defintion for the user-defined node “DanEDU.Sort” is missing! Do I need another file?

Ah ok the package works! If I replace the list.sortbykey node by danedu.sortnatural node, there´s an internal error: Dereferencing a non-pointer. It´s only sorting the numbers from “Mark” and not the associated categories, they are missing.
In the previous node List.sortbykey I had two lists, one with the numbers from “Mark” and one with the associated elements.
What could I do that the list is sorted natural with the depending elements? thank you

Yes I know But when I relate the elements of category with the sort natural node, its sorting the family names? That´s not what I want… I dont understand how I can combine both with the node

yes but I cant find enough relating to the sorting subject otherwise I wouldnt ask you here :grinning: especially on this package…

Thank you! I thought there´s maybe a quicker way to sort the Elements, but sort by key works too.

What do you mean a quicker way?

I see you are using the Mark which is a stings parameter so you can use String.ToNumber to change the sort order from alphabet to numeric. As long as you do not have letters in the mark.