Excel to Revit


#1

Hi everyone.

I’m new to Dynamo and have been working on my first script. So far so good, but I want to take it to the next level. I currently have a list of data in excel for tanks that I want to feed to Revit tank family’s parameters.

In my spreadsheet I will have ‘Tank number’ in Column A which is each tanks unique ID. In my Revit model each tank will have a Mark value representing the tank number. The tank family will have a a bunch of parameters that will match the data in my spreadsheet.

My question is, how do I get Dynamo to:

  1. Read my ‘Tank no.’ column in Excel

  2. Automatically find corresponding tank family in Revit by matching its Mark parameter

  3. Assign the rest of the data in that row to matching parameters in that family

 

So far I have managed to do this but it is very much a long-hand way to do it I believe and for every tank (could be up to 400) i will have to create a new script manually, so it needs to be more dynamic with perhaps one script that will do any number of tanks.

 

I would be really interested to see how someone with more experience would go about it.

Files below

Thanks in advance,

Sam.

Tank Farm


#2

Hey Sam,

One of the gurus might be better served helping you but I think it might be an easier/better way to export your element IDs to excel initially with marks etc. then when you import you can use the ID to element node which is part of the archi-lab.net package. Not sure how this will work in with your workflow.


#3

Did you have an example excel file for us to use to possibly provide a solution? Or at least a screenshot of your formatting?


#4

Hi John,

 

Yes please click on the ‘Tank Farm’ link below my name on the OP.

Or here:Tank Farm

Many thanks,

Sam


#5

Sam-

What you are doing is very similar to an example problem we worked through last month in our Atlanta Dynamo User Group meeting. We used Rooms and pulled data from and excel file using the Room # as the “link” between the two sets of data to find matches. You should be able to follow a very similar path to achieve what you are after.

Attached is the tutorial.

Atlanta Dynamo User Group Excel Example

 

 


#6

That’s great - thanks Ben, I look forward to having a look and reporting on how I get on.

 

Thanks a lot.

Sam


#7

Sam,

If you use the elements ID then you won’t need python to link the data together, it can all be done with Dynamo. I think it’s a bit safer because if the mark number is changed, even out of human error all the data will be tied to the element in Revit rather than by the mark. I’ve attached a graph below with an example. You’ll need the archi-lab.net package to run it.

Export-Import to excel


#8

If you have access to the element IDs and are ok using them, then you really should be using the GUID (UniqueID) as it is more stable than the Element ID.

That said, there are a lot of cases where the GUID or ElID don’t work. For instance if each row of the excel file applies to multiple elements (where the common denominator is some kind of beam mark or something) or where the excel file is being curated by a non REVIT user (and was perhaps created before there was even a Revit element to associate an ID with). In those cases, you have to use something other than IDs to tie it all together. Personally I find this more useful since it allows the excel and Revit to be decoupled and rejoined later (it also allows element deleting in the Revit file as well- which is not possible with ID matching).


#9

I loved the idea of being able to link by a matching parameter value, it’s extremely useful. I just thought using the element ID might be a better way depending on your workflow as I know it works for how I use it. But I can see many uses where matching a parameter would be a better idea.

I wasn’t previously aware of the element ID’s stability issues and was only using it because addons like BIMLink seem to use it as their way to match up data. I’ve done some reading about it now and I work on a lot of work shared files so it would make a lot of sense to use the GUID. It’s easy enough to export the GUID but do you know how to select an element by it’s GUID? I would like to modify the process I’m using to make it more robust. The Id to Element node doesn’t accept GUIDs. Thanks

 


#10

Thanks for your input guys, much appreciated.

Ben, what you are talking about is what i’m after and the situation we will be in. In simple terms, we have pre existing spreadsheets loaded with data on multiple tanks (Tank Spreadsheet). Each tank has its own ID and row of data. Now, the ideal situation would be once I create a Revit model with all the tank families, each with its own mark value equal to the tanks ID no. in the spreadsheet, Dynamo then:

  • 1) Matches the Tank ID's from the spreadsheet to the mark value of the tank family
  • 2) Applies the remaining data in that row from the spreadsheet to parameters built into the tank family.
Thats my goal!

#11

Jimmy-

The Grimshaw node does handle GUIDs…

Sam-

I figured that was the workflow you were after. The example I gave you will give you all the tools you need to do what you want. I was doing something very similar there, except using Rooms and Room Numbers. Best of luck. Feel free to send me an email if you have any issues.


#12

Sorry to confuse the issue guys.

Sam when I feed it a GUID it errors as invalid ID. If I need to know more I’ll post my own question though.
Thanks.


#13

I’m not sure if Sam ever got the answer he needed. So here is my workflow. And her’s the graph for your use. New Data

2015-07-17_11h53_08


#14

You should probably change “mark” to “type mark” or actually have the type as a family type of the main Tank family.

 

Then once you have done this you will then want to sort all the types in order to the excel sheet, Also something to note is that you may want to omit any null/none relevant information from the excel sheet via dynamo and list slice or remove at index.

 

Once all this is done it should be fairly easy to just plug it in to the elements.

 

Hope this helps further on top of J0hnp example


#15

This has been a very useful thread. thanks to everyone who has contributed so far.

In the example I’m working on I’m using this type of workflow with my room schedule. Wthin that I have a parameter which remains constant and unique call RoomID. I want to be able to filter the list coming from Excel against the room list that already exists in Revit based on this parameter. So for example if I already have ID’s 1,2 and 5 in the model and my list in excel contains ID’s 1,2,3, 4, 5 and 6 it will ignore everything bar 3,4 and 6 including all the sub lists.

Can anyone point me in the right direction of which node would be the best starting point?

Cheers

K.


#16

^^^bump^^^


#17

Hi John.

What is the node with name “–” in the data collection group in your routine?

 

Thanks.

 

A.

 

 


#18

Alvar-

I think that is an “==” node in John’s picture.

Keith-

Try this: