Importing Space Type Parameter from Excel

The error message is telling you that you need a different format than String as @Kulkul notes below. Since it is an integer storage type it is looking for an element ID of the storage type. You may need to get a list of Space Types and then filter your strings from Excel through to get the element of that space type. See this post for reference.

Brilliant, thank you guys! I will go back and try your suggestions in the morning :slight_smile:

Ok so i checked all the bits you suggested and changed my boolean node to false and now i get a new error message

error1

Ok so with a bit more digging i found that the Space Type parameter storage type is ElementID, i guess my questions is, how do i find out what the ElementIDs are for the different space types in revit?

Hi Kirsty,

If you follow Sean’s link, the next post down shows a method of getting the name from the type then you can go back to pick the one you want…

You could automate this by running the excel string into an ‘indexes of’ “name” then ‘get item at index’ from the types list.

Hope that helps,

Mark

1 Like

Awesome so I could populate more than one space type by following that method but adapting to use excel?

I’m not at a pc right now so I can’t check, you might need to tweak… I’m sure others have better methods :slight_smile:

Good luck,

Mark

1 Like

Use the All elements of Type to get a list of the space types, then get thier name and compare that to the name from your Excel. You could use and if node to then build the list of corresponding IDs.

1 Like

I tried all of what you suggested except the if node. How does that work to get IDs? Sorry I’m still a real novice at Dynamo but I’m trying to learn as much as I can

Something like this should work for you. Just plug the info from excel in where I have the “Active Storage” node.

2 Likes

This worked perfectly for getting all my space type element IDs. I added these to my excel sheet and tried bringing them into my original script to populate the space type parameters in my model but i am still getting an error

It looks like it may be looking for the actual Space Type (green highlighted piece) and not JUST the integer. Take the “Element.Id” node off the end of what I posted and see if that works for you.

nope that didn’t work either. I feel like i’ve not got the correct ID for the different Space Types built into Revit. From the class material at AU they seem to have IDs of 1 or 2 digits but this small snip of the excel is my only clue to how they populated the space type parameter. I have no clue what dynamo script they wrote or how they pathed the excel into it so i’m basically flying blind on the principle that if they can do it then there must be a way to automate the process!

It looks like they figured it out here. Have you tried this way?

@SeanP yep that works, it changes every space type to whichever index i type into the code block. I need to figure out how to adapt that so we can have it change to mulitple different space types depending on the rooms purpose.

I will try again tomorrow i guess!

That’s good. If you go back to my Post #15, you only need to connect your Excel data (space type) to where I have the code block with "Active Storage in it. Maybe if you would share the .dyn and a test Excel / rvt file we could help you string it all together. I think you are very close.

@SeanP sure I can upload the dyn scripts tomorrow (I’ve left my laptop in the office) and the revit file is just a blank template with the sample arch file linked in. The spaces are then copied in using rushforth tools.

Thanks for helping me out :slight_smile:

1 Like

Ok so i’m attaching a link to the blank spreadsheet template and the completed spreadsheet from the model export. The export script and the import script which obviously needs work before it can populate the space types!

Space Information.xlsx (13.7 KB)
Space Information (completed).xlsx (18.6 KB)CDL-Spaces Information Export.dyn (40.4 KB)
CDL-Spaces Information Import.dyn (44.4 KB)

@SeanP

I think I have resolved this for you. Please find the attached files for your use. The main reason your import graph wasn’t working was because you weren’t selecting the spaces to apply the Space Type too.
CDL-Spaces Information Export.dyn (43.3 KB)
CDL-Spaces Information Import.dyn (40.7 KB)
Project1.rvt (3.6 MB)

1 Like