Detail Number by Title Block Grid

I have found a script on Reddit that was able to renumber all the views on the current sheet. I stood on this individuals shoulders and set it up to run across all the sheets in the model.

I have run into a few issues.

  1. Legends dont have detail numbers.
  2. Some views are set to No Title
  3. The title block grid definitions need to be specified within the project units (feet for us imperial idiots)
  4. The script only runs with one title block size/grid system.
  5. Some views have their View Title within the same grid on the same sheet.

I have solved 1&2 in the script. I can ignore 3&4 because all our projects are in the same units and use only one title block.

But 5 is being a real bugger. I am trying to isolate the views that would be on the same sheet and also be within the same grid. I can find them but I don’t know how to put in a dummy variable and have the code explain which ones.

Maybe i need to write a separate script that can look for these duplicate views and remedy the problem before running the Renumbering script.

Beware that one time I was mucking around with the script and it deleted all the viewports in the project.


Renumber Views_R23.dyn (141.7 KB)
TBLK VA E1 30x42_v19.rfa (1008 KB)

When this happens, what would your ideal solution be? Personally I dislike this numbering style, but I get the desire. Getting the viewport center and building a vector from the lower left corner of the TB to that point does allow grouping and sorting by the rounded X value and then sorting by the Y value before renumbering, allowing easy numbering by ‘relative position’ on the sheet, even if 10 views fit in the same sheet. When duplicate number values are produced you can always append a suffix, or sort by element ID.

1 Like

I believe the ideal solution would be to alert the user to the sheet and location where the offending duplicates live. Then they manually adjust the sheet and rerun the renumbering script.

What if you want say an area plan overlaid on the life safety plan though?

then one of them has “No Title” set as the viewport type and is filtered out so that it does not count as a duplicate and it remains as is.

I feel i am close with one of these methods.

I have a working solution. I added a new list combining the sheet number and the detail number values (prior to setting them in the project). I then looked for duplicates and used an IF node to use the list of sequential numbers instead of the alphanumeric grid values if there are duplicates.

This will set all the views in the project to sequential numbers and report the sheet number and grid locations of all the conflicts in the model. If you manually remedy the viewport conflicts, you can then run the script and it will set all the viewport detail numbers to the grid locations.


Renumber Views_R23.dyn (132.7 KB)

This script only works in Revit 2022 and newer.