Drawing List Management with Dynamo
This is not your typical workflow for managing a drawing list, but due to some complicated overlapping schedules and the need to possibly issue drawings with the same number (yet part of a different package), we ended up adding a Package Prefix to all sheet numbers. Here’s what a sheet number looks like on one of the projects that I work on:
The 02 prefix indicates a package number (in this case package two). However, with this numbering scheme we had to come up with a separate way to sort them when scheduling. Why? Because a sheet with a number 01 A05 003 would schedule before 02 A03 001 and that’s not exactly how I wanted that drawing list to be sorted. I used Dynamo to quickly get each sheet number, strip the leading package number from it and write it back to a sorting parameter. Easy enough, here are the steps:
First, I collected all of the sheets in a project. Then I extracted all of the "Appears in Sheet List" parameters to check if that’s an actual sheet or just a presentation sheet. I really didn’t have to filter them out like this, but the less of them, the faster the process. I used a custom node called "Dispatch" to get only sheets that were getting scheduled.
Once I had all of the sheets that I wanted to work on, I grabbed the Sheet Number from each and stripped the first two characters (the package number). I used two custom nodes to do that. The first was "Replace Substring" which I used to get rid of all white space characters. It’s not obvious by looking at the image but the String node going to the "search" input is set to search for spaces or in programming, " ". The "replace" input is supplied with an empty string node thus deleting all spaces from a string that it’s being applied to. Once spaces are gone I used a custom node called "Slice String" to remove the first two characters.
The last step was to set a new parameter called "SheetNumberSort" to a new value. That’s easy with a custom node called "Set List Instance Parameters". It will need a transaction node at the end since there are changes to Revit DB that need to be committed.
That's it, and here’s a drawing list sorted by this new parameter:
Remember to add all appropriate parameters to your project in order to operate on them.
This definition is relatively low risk, since it writes data to a new parameter, but keep in mind that it makes changes to Revit DB. Always test on a detached version first.
Good luck!