I have tried to make a script so i can copy some text from an instance parameter to another, but it does not copy the text, it replaces it.
I can make it work with type parameters, but i need to make it work with instance parameters to.
Can anyone help me?
I did not get how you wanted to copy a parameter to another and not replace the original value of the second ?
That is what I want. I missed a word in the desription.
I want to copy the text from the parameter “Comments” to the parameter “Switch”. So I have the same text in both parameters.
But I can not make it work, and it takes a lot of time to run the script.
Regarding the “time problem”, I think this is because the Element.AllInstances node is useless. I highly doubt that you actually have 97969 Lighting devices in your projet (my guess is that you have 313 devices), and you should directly connect the All Elements of Category node to the following ones.
Secondly, could you be more specific please ? Like turning on the preview of all the nodes in your screenshots, describing why your graph does not work, what you see in Revit that you shouldn’t, etc. Because it is really hard to help you with this little info.
Remove the Element.AllInstances node and Element.Type node. Connect the All Elements Of Category to both the Get and Set Parameter nodes.
I have removed the two nodes and connected them now, but I still cant copy the text from “Comments” to “Switch ID”. When I run the script nothing happens. I have made a similar one where it is type based info I am copying, and it works perfectly, but nothing happens here.
Could you please provide a Revit dummy file ? I have no clue why it isn’t working.
Also, have you tried using the OotB node Element.SetParameterByName, rather than the one you are currently using ?
What is the Storage Type of Switch ID? I assume it is Text. Have you tried just setting the Value directly to see if that works, instead of reading the Comments?
For what can be seen in the picture the name of the parameter is “Switch ID” whereas in the Dynamo script is “Switch - ID”.
They should be the same, don’t they?
Thank you @franciscusm. That was the solution