I have a Project Parameter assigned to the Doors Category called COBie.Type.Name. It is a Type parameter and is Text. Most of the families in this category have a unique value manually populated for this parameter, some may be blank. I have created another Project Parameter called Type.Name, also a Type parameter, also Text, and also assigned to the Doors category. There are a total of 39 Types within this category.
I would like to create a script to simply copy the values found in COBie.Type.Name into Type.Name for the respective Type, even if it is found to be blank.
My thought process was to collect all elements of the target category and then get the specific source parameter by name and use Element.SetParameterByName to copy the values into the target parameter. Unfortunately Element.SetParameterByName returns “No Parameter found by that Name”.
I set watches on the the 2 major collectors and it looked like Element.GetParameterValueByName (Rhythm package?) was returning a broken list (although a correct count). However when I disconnect it and use a code block to insert a “Test” value for all entries I get the same error which suggests the problem might be with the AllElementsByCategory function.
FWIW, I get the exact same output if I opt to go by Family Type. That is somewhat encouraging because I’d rather address the Category as a whole rather than all 39 different Families. I do feel like there’s something missing before Element.SetParamaterByName at the element node but I have no idea what.
I found the issue (though not the solution). If I attach a Element.Parameters node to the output of All Elements of Category I find that i am only outputting instance parameters instead of type parameters. I have no interest in the instance parameters, I am specifically wanting to access type parameters.
Then you either need to use one of the nodes that works for both instance and type parameters or get the family type and set the parameter for the family type. I prefer setting the parameter for the type.
Nick, I understand (mostly) what you are saying but can you be more specific? I was trying nodes that were specific to family types but still ultimately resolving to instance parameters. My goal is, as you say, to set the parameter for the type but I am a rank novice and have no clue which particular node performs that function and my searching has failed me.
Okay, Benjamin, it worked for me as well when I swapped out my SetParameterByName node with the Type or Instance version you showed from the Rhythm package. thanks to everyone. It is nice to know my original premise wasn’t too far off I was just using the wrong node type.
I can’t mark more than one post as solved. The original suggestion to use the Element.Type node was good as well.