My task is to take an excel spreadsheet that has a list of unit selections from a vendor, extract and organize the data I need, and push that information into a set of parameters. After a lot of searching and reading previous posts, I’ve hit a wall.
To this point, I’ve essentially:
created a filter to list only the elements I need to push information into
formatted the information in the excel into a series of sublists
used a dictionary to put the information in the same sequence
The problem is when I finally try to write the information to the parameters. Some of the parameters write, and some don’t. From what I can tell, the parameters that don’t write get removed from the list, and the subsequent value that can write moves up to the next available parameter on the list. The latest error I received states, “The parameter’s storage type is not a number.” I’ve gone through the excel spreadsheet to ensure that the cell format matches the parameter’s; I assume that any parameter formatted for engineering info (non-text) will accept numbers, so I tried to match up text with text and numbers with numbers/engineering values. I’m at a loss and I have a lot of data to compile in Revit.
The snip below shows the end of the script where I’m running into issues. The circled part shows where I checked the pairing between the indices in the excel file and the parameters I want to write to.
@Nick_Boyts Are you saying that, even though the values in the excel file might be set to the same format, when the script processes the information, it still converts those values to numbers?
Fortunately there are nodes that convert strings(text) into numbers, and the other way around.
String from Object wil turn everything it receives into text.object or tries to.
There is also a node that tries the opposite. Number from text i think.
I tried using a known text parameter and a known integer parameter for the “Unit Size” value, which is just numbers. It would not populate in either one. There doesn’t appear to be a discernible pattern for what’s written and what isn’t since the same parameter will populate for other values, and the placement of values isn’t consistent. I’m also toggling input levels, but I don’t think that’s it.
I’ve included the sandbox revit file with the equipment I’m trying to push info into, the corresponding XLS file with the data, and the current script in the OP. I’m still trying to work through it. If I find something, I’ll post.
I ended up restructuring the parameter data to match the list count of the number of elements I needed to write to, and it matched up almost all of the parameters. Only thing I noticed that was off so far is the EWTs and LWTs.