Hello, I am trying to copy data from an Out of the box revit parameter, Type Mark, to a shared parameter that we created, CES Category. I’ve got the data pulled for the type mark, the correlating families, and the Shared parameter but continue to get an error when trying to use Element.SetParameterByName. Any help to make this work would be appreciated.
Wire the string ‘CES Category’I to the parameter name inout of the node which is erroring.
By feeding that string into the Parameter.ByName node you are getting a parameter element not the name of the parameter. Dynamo will take care of fetching that parameter element for you if you just pass it the name of the parameter you are after.
It still isn’t working, it is saying that parameter cannot be found.
But if you look at the bottom watch panel you can see that parameter was found in each of the specialty equipment elements.
Will need a sample file to reproduce. Post a clean file with just a handful of elements (5-10 total - delete and purge everything else) and I’ll have a look tomorrow.
You’re doing the same thing @jacob.small mentioned with the parameter value as well. You’re feeding a ParameterElement instead of a value. Use GetParameterValueByName
instead.
Good eyes @Nick_Boyts!
I’ll try to get a file to you but I did swap it out for getparametervaluebyname and it did not work. I think Dynamo is having issues writing to the shared parameter.
Based on my experience here, your users will find it far easier if the targets are clearly defined in the script name. I’d say make three versions of the tool:
- Type value to type value
- Type value to instance value
- Instance value to instance value
This saves the need to introduce conditionals that users will probably get wrong anyway, and makes the scripts easier for users to pilot with intent/understanding. I’ve included examples of each workflow below in order listed above:
Is the intention for CES Category to be a Type Parameter or an Instance Parameter?
The most recent screenshot suggests that you have CES Category set up as a Type Parameter since you’re getting parameter data from the equipment ElementType.
If you want each instance of the family to have a parameter filled, ‘CES Category’ needs to be an Instance Parameter (change your shared parameter settings).
If you want each type of the family to have a parameter filled, you need to wire the element type to the setparameterbyname node, not the individual elements. Functionally this is just passing Type Mark to CES Category, type for type.