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

excel

#1

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!!


#2

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?


#3

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…


#5


#6


#7

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.


#8

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:


#9

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


#10

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.


#11

@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.


#12

Is it natrual sort order you ask for?
then try to see this


#13

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!


#15

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?


#16

you should download the DanEDU dynamo package… and if you want to use the natural sort order, then use that node (Sort.Natural).

but I am affraid what you ask for is not my sorting mechanisms, but sort by key as you showed earliere just give it the right input to sort.


#17

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


#18

The value you get from “Get Parameter” node doesn’t give you any element… it gives you a value. Please correct your mistakes and feed the nodes with the proper input.

The way your graph looks, you sort numbers, and if that is what you want to sort, then you can use the built-in sorting mechanism… however, that will not give you elements either, you need to use your values as keys for sorting your elements.


#19

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


#20

Have you done the tutorial? and looked into the dynamo primer?

There is much basic stuff you can learn there that can be very beneficial.

Here is how i think you should do it


#21

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


#22

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