We need some help in developing a script to assist our Revit teams in production.
Currently, we have a large project with multiple rooms, with each assigned a corresponding tag for room code, name, area and comment. These are all done manually based on and is time-consuming.
The idea (if possible) is to create a detailed excel file by encoders instead of Revit specialists, inputting a code, with corresponding room code, name, area and comment. Those in Revit would only need to tag the code and with a Dynamo script, read this code per room, search for the same code in the Excel, take the associated information, and tag this on the element.
You can not tag directly from excel sheet I think … You might create an instance parameter to those rooms and feed it with the required tag value from excel then change tag family label to that parameter to be displayed instead of default one.
we are actually non-engineering staff who are familiar with programming but not so much into Revit.
I might have used an incorrect term in explaining. What the goals is to take a room’s number (such as SB101), search for it in the excel file, retrieve the information corresponding to that number (which contains the room code, name and comments encoded in an excel file) and set them as the corresponding properties.
we are currently using the Element.GetParameterValueByName node but are still working on the script and setup, and have not gotten it to work yet.
t1_1.dyn (42.9 KB) 1.xlsx (8.5 KB)
Try this script on Dynamo 2.02 along with excel sheet, Sure you might change name of parameters as required or add new ones.
thank you for the sample code… i was able to try it out
this is the first time I’ve used this node “SortByKey”. This error came up when I tried your test program and excel
this is actually the WIP version I have been trying before I saw your reply. It seems like we are on the same track and idea as I see similar logic. In my version I am also getting the same error message “internal error dereferencing a non-pointer”
You can use a “Watch” node to check how your input in “keys” and “list” look like. It may be a hierarchy problem, different levels in the inputs.
I got it to work. Seems like clearing some cells in Excel resulted in them being “null” but there were still being recognized in Dynamo, hence an incorrect # to keys error
I tried it one when selecting a single room + having only one entry in the excel file (other than the title) it works perfectly now, thank you!
one problem that i notice however, is that if the # of entries does not match the # of selection (or the total number of elements) the program will result in an error and not run
could there be a work-around for this? for example, only a handful of elements need to be updated, but the excel file has the complete master list of everything
seems like the code is working but only for one entry (labeled in red)
the node ByParameterStringValue comes up will all 3 items in the list, but the next node SetParameterByName only considers the 1st one.
what is a good solution so that the other rooms (labeled in blue) are also considered by the SetParameterByName?