Copy data from one Revit parameter to another

Hello,

I am trying to transfer data from one parameter to another for all rooms by using dynamo but I end up getting an error that says “The parameter’s storage type is not an Element.” The parameter I am trying to copy from is a key name from a key schedule(COST CENTER) and I am trying to send each room’s info from that key name parameter to a new shared parameter(Cost_Center).

As you will notice in my images I have tried a couple different scripts but get the same error for both so I am not really sure what is meant by “The parameter’s storage type is not an Element.” You will notice the one script is pulling from an excel file and that is the one I would more so prefer to get to work. I know it is a large script as it is setup to transfer other data as well so the main focus is at the bottom for where the error is.

Thanks in advance for any help provided!


Here is a zoom in on that larger script.

The value of the key parameter is the key element itself. The second parameter is not a key parameter so you likely want just the string value representing the key. You should be able to get the name of the key element and write that to the new parameter.

Hi Nick,

I am sorry but I am very new to Dynamo so I am not understanding what I should be changing. The large script I was given help on creating so it is hard for me to understand but if we just work off this smaller script for now are you saying I should add in “string” instead of where I had the code block? My understanding on this script is that I am getting the parameter from each room and I am trying to set the new parameter to that same value.

If possible, can you please sketch over my recent screenshot or just make a list of directions?

Most parameters are strings or numbers, however there are some parameters that are associated with actual Elements. Common examples include Workset, Phase, or FamilyType. While Revit shows these parameter values as user-readable strings, the actual value is the reference object itself.

Key Parameters are the same way. A Key Parameter is given the value of a specific Key, which is an actual Revit Element, not just a string. So when you get the value of the original Key Parameter, Dynamo returns the Element. The secondary parameter that you’ve created to connect these elements is a string parameter and therefore needs a string value; i.e. you cannot write the Element value to the string parameter and must first convert it to a string. You do that by getting the name of the key Element and writing that value to the second parameter.

I think I am understanding what you are saying. So Dynamo can not make this transfer and I will have to transfer the info from the key name parameter on each room to my created parameter? I was hoping there would be a much better way to transfer all of this info as each room may have something different.

Dynamo can absolutely do this. You just have to provide the proper data in the proper form.

It’s apples and oranges. The first parameter returns an Element. The second parameter requires a string. An Element is not a string. You must convert the Element to a string so that the second parameter can accept the value.