Centering the viewport inside the window of a sheet

I want to be able to center the viewport in the center of the window of a title block and not the center of the whole sheet. What I am doing now is I am getting the bounding box of the title block, extracting the min point and max point from it, the calculating the center of the sheet and moving the center of the viewport to the calculated center using the viewport.setBoxCenter node. Is there a way using Dynamo to do it without manually measuring the window of the title block. If not are there any changes advised to the title block/frame that can help me do it?

There’s nothing natively available to title blocks that could “automatically” get you the center. Calculating the center of the bounding box is usually the quickest solution. However, you could add specific line types within the title block to define the view portion of the sheet. Then you could calculate the center point of those lines instead of the whole title block.

A lazy way to do this assuming your ttbs are all the same is get the titleblock bounding boxes and that boxes min point. Draw a line from that corner in revit to the ttb frame centre, get its geometry in dynamo, make that a vector and use that as a translation for all min points per sheet.

1 Like