I have added a custom parameter to Rooms in my Revit model for “AREA TYPE” and want to export it as a column with other parameters to Excel. Even though I went to several rooms in the project and populated this new parameter with values, my Dynamo definition isn’t producing anything. Any ideas for how to make this work?
I am attempting to extract 4 default room parameters using the LunchBox Room Element Collector (level, name, number, area) and then add the above portion of the definition for custom parameters added to the Rooms. At the Excel.WriteToFile node I am getting a null result with the warning: “Excel.WriteToFile operation failed. Index was outside the bounds of the array.”
note: I changed the parameter name to SPACE TYPE, still not working…
I tried running the custom parameter node to the data port by itself and that worked, overwriting the information in the first column of my spreadsheet with all of the corresponding Space Type values (images 1 & 2). I then went back to running the default room parameters from LunchBox and that worked just fine (images 3 & 4). Finally I tried to run them again all together from the same List.Create node and the same error occurs at Excel.WriteToFile (image 5).
Could the problem exist between List.Transpose and the data port of Excel.WriteToFile? Is there a way to merge the two streams after List.Transpose? Also, if you look at the excel output in Image 2, you will see that some of the Space Type cells are blank, could these null values (or lack of values) be causing a problem? I did not get the chance to go through every room in the Revit model and apply a Space Type to every single one, I was hoping to do that after the definition was working properly.
@Marcel, unfortunately inserting File.FromPath between the File Path and Excel.WriteToFile nodes only generated an error.
I finally found the problem but could use somebody’s help with a solution…
Because I am attempting to extract the custom parameter Space Type, this portion of the definition is pulling ALL rooms from the model including those that are “unplaced” and “not enclosed”. Therefore the output from List.Transpose contains 621 items however there are only 502 placed rooms, meaning that items 503-621 only list Space Type (see image below). This is what is causing the error in the Excel.WriteToFile node.
Is there a way to specify only placed rooms? (It seems that the LunchBox Room Element Collector node has achieved this)
Or, is there a way to filter out items in the index? (in this case, lines 503-621)
When I run the exact same sequence of nodes you used, I get an error at the List.FilterByBoolMask node: “Warning: List.FilterByBoolMask operation failed” (image 1)
Secondly, if/when I get this sequence to successfully filter out unplaced rooms, how/where do I link that back into the rest of the definition to join the rest of the parameters in the Excel export? (image 2)
I dug a little deeper into the filtering of unplaced rooms… It looks like the node Room.IsUnbounded is returning two null values and thus causing an error at List.FilterByBoolMask.
Also, there are two more items coming out of the rooms list (520) than the Room.IsUnbounded node (518), could this be causing a problem (image 1)?
After creating a schedule in Revit, I realized that there is a combination of unplaced, not enclosed, and redundant rooms in the model. Does one of these items cause null values for the Room.IsUnbounded node?
I finally got this definition to work by removing all unplaced/not enclosed/and redundant rooms via a Revit schedule.
However, I really need to figure out a way to filter these items out to counteract users’ poor Revit modeling practices, if anyone could help me out with some ideas of how I might achieve this, I would really appreciate it.
Another annoying problem has emerged… Even though I can now get the 4 room parameters from the LunchBox Room Element Collector to exports successfully with the same exact number of index items as the custom room parameter, I have discovered that the exported values do not match at all.
Somehow the parameters have become completed dissociated, does anyone know a way to re-establish an identical index order so that the values export correctly?
After making a simple adjustment and re-running the definition, all parameters are now exporting to Excel with the right association. I will call this one solved for now but I would appreciate any suggestions for a way to filter out unplaced rooms in an index in Dynamo…
You’re using List.Flatten instead of Flatten. If you use List.Flatten, you need to specify how much to flatten (ex: wire a number 1 from an integer node or a code block). That’s probably what’s causing the error in the image above.