Autofill a column in schedules

Hey there,

I am trying to autofill a column (Mark) with a prefix P and a number behind in order from P1 to Px (in this case 17) is it possible to fill in cells in schedules using Dynamo or do I have to make the whole filtering and sorting/grouping process in Dynamo itself (so without using a schedule) ?

image

the thing is that I am unable to make a script that can sort and group the detail items by two parameters (description and length) and then fill in the Mark parameter in correct order…

I want to have the same Mark value for items that have common properties - so for example you can see the ø6 - 40 mm long is there 2x so I want both of those elements to have a duplicate mark value (P1 for example)…

Would anyone be so generous to try and write a script like that or at least try to guide me?

As stated in section 7 of the “How to Get Help on the Dynamo forums” FAQ, we won’t do your work for you. If you have tried to create a script and failed, please share a clip of what you have done along with any errors you are getting and we will gladly help you through the issues. Someone may already have a script and are willing to share, but looking for that up front will not yield a lot of responses. Also there are several other threads in the forum about mark numbering with examples. Try searching and reviewing those. You may find everything you need.

When creating your script, just step through the process.
First Group all elements by the Description first. Use GroupByKey where the key is the Description parameter value. Then sort those results by the Lengths. Same process using SortByKey. From that point it’s simply setting up your numbering sequence similar to as shown below and using the set parameter node to assign the values to the Mark parameter.