Set parameter for element with condition

Hi guys,

I’m newbie in Dynamo.
I have a problem with script. Hope you help me to solved.

I have curtain panel with different size. I want to set “Mark” of that curtain panel with condition: curtain panel same volume have same Mark.

In dynamo, i get volume of curtain panel, then, i don’t know how to continue.
Can you help me to solved ?

My English is bad. Sorry for the inconvenience !
Many thanks!

So you want the volume of the curtain panel to be the mark value?

It looks like you more or less have it. Get the volume of each curtain panel, round values if required, convert it to a string (as Mark parameters are strings) and use the setParameterByName node.

The list lengths will need to match which maybe why you are having issues with the code block.

You may also get an error if 2 or more panels have the same volume and therefore the same mark value.


Don’t know if this is what you meant but I am going off a different interpretation than @Paul_Wintour.

I believe you could also use groupbykey command with the volumes as keys and panels as the list. From there, you can assign marks based on volume groups. As @Paul_Wintour said, you will get warnings of multiple marks being used.

See below:


Your idea is very good, but i think kenny b6 (under post) clear than your post.
Thank for your help!

Solved by you!
Many thanks!