Hello,
I’m trying to make an Excel schedule in which I can change the model number of a piece of equipment(heat pump in this case), then use Dynamo to push that change to Revit. We have a heat pump family that has different model numbers for different family types. I’m able to create the excel spreadsheet using Element.GetParameterValueByName, however when using Element.SetParameterByName to bring it back in it says “The parameter’s storage type is not a string.” even though I’m using the exact same string I used in GetParameter. Below is what I have so far. I’m using the same format to change equipment CFM and equipment numbers, both of which are instance parameters. Can anyone help?
Thanks erfajo, however I’m still getting errors. When I try to do it numric back to string, I get a “No parameter found by that name” error. Below is what I’m getting. I can only post one photo per post, so I’ll have to post another one for going string to numric.
When I do string to numric, it tries to change the parameter name to str so i also get the “No parameter found by that name” error. Do you see anything else I may be doing wrong?
As far as i know “ParameterName” is Always a string.
Erfajo means change the “value” to integer
Try to set String.ToNumber between List.GetItemAtIndex and the “value” from Element.SetParameterByName
1 Like
Thanks for clearing that up! I’ve never done any kind of coding before so I’m just learning from Youtube and Google. I set the String.ToNumber between List.GetItemAtIndex and the “value” from Element.SetParameterByName like you suggested and still get an error. It’s weird because it’s acting like this code block is changing the parameter name to str. Any ideas on how to fix this?
with the node object.type you can see what kind of type (string, double, …) your trying to pass
put the object.type on the “item” from List.GetitemAtIndex and show the elements in both List.GetitemAtIndex and the object.type with the watch node
The information that is coming from the List.get module is a likley not a valid item that can be converted to a number. put a watch so that we can see what is at index [3] and or pin module down so we can see it.
this will not work due to the string is three written
this will work because the number is in
quotes thus making it a string.
Thanks for all the replies yesterday! I was out of the office but am digging back into this now. Below is a snip with a watch on the item from the List.Get module(showing most of the parameter, you have to scroll right to see all of it). I’ve also added a Object.Type with a watch on it as advised by @EzDoesIt. @erfajo I’m happy to upload any files you need if you want to get into my .dyn and play around with it. What all do you need other than the .dyn and excel file? Do you need my Revit file as well? Since I’m new to the forums I’ll have to upload each of those in individual posts, but that’s not a big deal for me. Thanks again everyone for the help on this!
As you can see there in the watch that is not a valid number and the reason you are getting the errors converting it to a number. please refer to my other two post showing you what the String.ToNumber is looking for.
You are trying to pass “Family Type: TTV026, Family: H - Hea…” into parameter “Type” i guess this is not the correct value.
You can adjust this in your excel file.
Thanks @erfajo. Being a new member of the forum, I’m unable to upload files to the forum. I’ll take the info everyone provided here and do my best at getting my dyn to work.