Mark Parameter Not Found

I am getting a “Warning: Element.SetParameterByName operation failed. No parameter found by that name.” error in my script.

The goal is to select all of the VAV boxes in the Revit model and renumber them automatically if/when any are added or removed.

I have been able to successfully filter the VAV boxes out from the rest of the mechanical equipment, but it looks like Dynamo is unable to find the mark parameter for any of the mechanical equipment. (I’ve also tried running the script on the comments parameter and am getting the same result.)

I’ve successfully used a similar script to number sheets in the past and in the link I’ve included below, it looks like Dynamo was at least able to find the mark parameter in @Joaquim_Agostinho1’s script.

I must be missing something. Does anybody have any experience or possible solution to this? Any and all help is greatly appreciated!

It looks like you’re trying to set to set the ‘mark’ parameter of a type rather than an instance. You either need to feed an instance element into your SetParameter node, or set the ‘type mark’ parameter instead.

Hi @Colton_Haney

there are several sources of errors to your script.

  1. you are passing values to family types. Mark parameter is an instance parameter.
  2. the values you are passing to the Mark parameter are integers. The parameter needs string values.
  3. the number of inputs (number of instances/elements (93) is different from the number of parameter values (89)).

Please check the logic of your script.

-biboy

Thank you! It looks like that was the issue. Once I got the instances of the families by using the FamilyInstance.ByFamilyType node and filtered that list down to a single non-nested list with only the one instance of each piece of equipment, it worked.

Thanks! I managed to get it working by passing the values as strings to the family instances rather than the family types.

The number of elements the script initially grabbed was 93, because it was selecting ALL pieces of mechanical equipment (VAV boxes as well as AHUs), I filtered out the 89 VAV boxes because I only wanted to set the parameter for those pieces of equipment and not the AHUs.