How does the .SetPropertyValueByName-Node work? (List inputs)

Hello,

I’ve been using the “PropertySetExtensions.SetPropertyValueByName”-node with success but I’ve only ever fed it with one input for propertyName/propertyValue:

With this script, each of my cubes gets its corresponding value for property A. So far so good.

Now I tried to assign values for each cube for the properties A, B and C simultaneously but no matter what I tried lacing- and levelwise I can’t produce the wanted outcome of A: Value A, B: Value B and so on:

I don’t understand how this node processes the inputs - if someone could help me out, I’d very much appreciate it! :slight_smile:

AddPropertysetdataWithListInput.dyn (32.0 KB)
Testdrawing.dwg (573.7 KB)

Start by changing this
image
to this
["A", "B", "C"];

Add a List.Flatten node after the Object.AddPropertySet node if the output is a list of lists

EDIT I think its a bug in the PropertySetsExtensions.SetPropertyValueByName node

EDIT 2 Change the code block as above, use levels & longest lacing as below
image

1 Like

Thanks a lot - you just saved me from a ton of duplicate nodes!
(And looking at the edits, I’m glad to see that it messed with your head a tiny bit as well! :-))

I think what derailed me was the fact that I immediately discarded settings that led to “12 solids” when I fed the node with 4 solids but apparently that’s how this node works. If it said something like “propertydata” instead of “solid” it would make more sense but apparently it really does duplicate the solids as you can even bring them back into the drawing:

I’m just glad it works!

1 Like