Ruby Script to number dynamic components

I have a number of dynamic components all with a custom attribute name Y10_PartNumber. I would like to have a ruby script that would take all the instances and assign a sequential number to them. For example if there 30 different components or instances I would like to assign numbers 1-30 to that Y10_PartNumber attribute in the dynamic component.

I only need the script as I can create my own toolbar and input the script.

Script should renumber all once button with script is pressed.

Did you check SketchUcation for “Number Components”?

yeah I did. It is only suitable for numbering the instance and unfortunately I cannot get the instance number into the attributes on a DC

1 Like

I don’t know much about dynamic components I’m afraid, much less coding, but why do you want the numbers in the attributes?

I need it for reports.