Set multiple material parameters to null

I’m using the Elements.SetParameterToNone node from Springs to reset material parameters for several elements to “By Category”. It works great when I define the exact parameter name I want to change in a string and plug that into the paramName input, but fails when I try to feed it a list of parameter names. I’ve tried using String from Object to convert the list of parameter names to a string, but that doesn’t work. I’m new to Dynamo, so perhaps I am missing something obvious?

@Amanda_Lunger_AM ,

i can`t see your input to elements, but i think you have to flatten your list —> elements…

KR

Andreas

thanks, that didn’t seem to make a difference though. here is the full screen cap:

Since we have a hodgepodge of furniture families all built differently, i figured I needed to have a set of nodes to take care of instance material parameters and another set to deal with type material parameters. But neither of those operations seem to work once i feed a list of parameter names into the node.

We can’t see your nodes. You need to zoom in far enough to be able to see the node names, then hit the export workspace as image button. It can also be useful to pin the preview dropdowns on important nodes.

1 Like

You’ll have to use list levels.

Does each element contain all 4 parameters or is that just an attempt to cover your bases?

1 Like

oops, thanks for that. i’ve rexported the image.

not all elements contain all of the parameters, so if there is a more elegant way to go about this I’m open to suggestions!

The better option would be to get the elements and check for parameters with each of those names to only get the one parameter needed, but in theory it should still work with all parameters. You just need to get the list levels working since the node seems to be setup for only a single parameter.

The issue is that some elements do have multiple material parameters, and I’d like to be able to wipe the parameter value for all of them at once. This is a script that will be used across multiple projects with families of varying parameter names, so a static block defining the parameter name won’t do.

I did a test where I created a manual list of parameter names, plugged that into the node and it successfully set all of the material parameters in the families that had them to null. So it seems to handle that list just fine.

I don’t understand what the difference is between the list I manually created and the one that is generated in my List.DropEveryNthItem node – they look identical to me.

In one list the values are strings and in the other list the values are not(?).
Try the String from Object node after the List.Drop… node.

I do that upstream, so the list should be a string already by that point. I tried it again for good measure where you suggested, and still no luck :frowning:

You’re saying even with the new list levels the original list of parameter names doesn’t work? Use an Object.Type node just to be sure. They do look identical to me as well. You could also use an == node to compare them to each other.

Got it! It was a silly user error thing of course. Using the == node was a super helpful tip. It returned ‘false’ when comparing the two lists, because the values in the parameter list I had generated had an extra space at the end (result of forgetting to add a space to the separator input in the String.Split operation).

Works perfectly now, thank you everyone for your input and help!

1 Like