Modify Revit Material Mark Parameters

Hello, I’m attempting to use Dynamo to modify dozens of Revit Material “Mark” parameters. I have a Material Take-Off schedule that populates certain materials by a filter reading the Mark parameter. In this project, we grouped materials by a prefix “N-” for a north building and we now want to move the “N-” prefix for all materials. I attempted the below script, which is similar to how I set up a bulk sheet renaming script but it’s not working as I expected. I feel I’m somewhat a beginner, especially when it comes to sorting lists, so I appreciate any advice. Thanks!

You are slicing the strings manually, but not the material elements, so the mark parameter is being set for the first 12 or so materials. Further you can’t slice the materials because the List.Sort on your strings is going to put things out of order.

Instead try this

  1. Get the materials as you were before
  2. Get the mark value
  3. Test the mark to see if it starts with the prefix to remove using a String.StartsWith node
  4. Use a list.FilterByBoolMask node to filter out the list of materials from step 1
  5. From the ‘in’ output of the filter by book mask node, build your graph as you has it before.

Thanks, Jacob. I updated my graph with String.StartsWith and the list filter. It seems much more logical, but still not seeing the change applied after the filtered list.

I wonder if I am inputting the wrong set of elements in the SetParameter node? You’ll see in the image that I connected it back to the All Elements of Type Node…if I’m supposed to connect the SetParameter node to one that is after the filtered list, what node am I missing? Thanks!

You want to filter the list of elements, not the strings.

The 1 is where you’d insert most of your prior graph, getting the parameter value, removing the first two characters, and then set the element (from the 1) parameter value for the new value.

“Filter the list of elements, not the strings”

Oh, of course, that makes much more sense! Thanks for correcting my logic and approach - it helped produce the result I was looking for. Below is the corrected graph. Thanks again!

1 Like