Changing a string list to an element list or whatever it takes!

Hello,

I am creating a script which, using pick order, will change the Mark value from any elements into an ordered list. We use double digits for our lists, which means that ‘1’ displays as ‘01’.

I am stuck in this last stage of converting ‘1-9’ to ‘01-09’. I think that ‘Element.SetParameterByName’ isn’t working because ‘ListFilterByBoolMask’ is producing a string list instead of an element list. If I am right in this, how can I fix this? Or else, how can I make this script work?

Thank you and Screenshot below.

Edit: Error says ‘dereferencing a non-pointer’

You are right that you are feeding it a string from the FilterByBool node. If you need the string as well then you should create a second FilterByBoolMask node using the same mask input but use the element output from the ‘Changes mark value from 1-n’ group as the list input.

A String.PadLeft node would help here. Use a “0” as the padding character and set the value to 2 (or 3) digits as needed.

1 Like

SOLUTION BELOW:

Thanks for your reply Jacob.
Edit: Doh! Works perfectly!

Thanks for your reply Kenny. I don’t need the string necessarily - I am just wanting to create a number list which always has the same number of numbers in it. ‘01 & 30’ or ‘005’ & ‘067’ etc and set this number as the mark value.

I am a newbie, and not a coder and so I struggle to fully understand your reply.

Edit: worked it out! See my reply to Jacob.

Please mark a solution so others can easily resolve their issue should the have the same problem.

Thanks!

No worries, edited reply to do this