String Replace vs Element set parameter by names

Hello everyone,
I am writing a script to change View name i.e rename views.
I found a script in internet,They use “string.replace” and “Element.SetParameter name” in execution.
My query is If string replace rename a view name what is the purpose of element setparameter name or vice versa.

Can Please differentiate the difference between “string.replace” and “Element.SetParameter name” ?

in basic workflow if you want to change some letters in the view name you will need them both, string.replace will change the value of the text but inside Dynamo environment not revit, Setparametername node will take the result and reflect it in the revit.

so if you want to put new values to the views, you can use Element.SetParameter node , but if you want to modify the exist values of views names, you have to get them, and make String.Replace and finally use Element.SetParameter to set values back to revit

1 Like