# Position Viewports on Drawing Sheets

**URL:** <https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757>\
**Category:** Revit\
**Tags:** revit, dynamo, views\
**Created:** [September 3, 2020, 3:44pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757 "2020-09-03T15:44:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew.smith](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@matthew.smith](https://forum.dynamobim.com/u/matthew.smith)\
**Post date:** [September 3, 2020, 3:45pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/1 "2020-09-03T15:45:00Z")

</div>

So I am relatively new to Dynamo and I am trying to create a simple Script that will allow me to choose views that have been created in Revit, then place them centrally onto a drawing sheet that gets created from a Template Title block.

I have cracked the first part of creating the Sheets and placing the relevant Views onto them

 ![Apply Views to a sheet Script](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/2/d2cb16a4a3e4699160aca14af06e3dc5504654f1.jpeg)

The issue I am having is trying to get them positioned centrally on a drawing sheet. Now going through the forum I have seen and obtained Nodes like ViewportAlignment, ViewportBoxCenter and so on… I have downloaded some of these Nodes yet they come with errors which I have tried to Rectify but to no avail.

So the help I need is in 2 parts;

Firstly does anyone know how I can rectify the custom nodes so that they work?

Secondly can anyone help me in finishing the Script off for positioning the viewports centrally on my sheet.

Thanks in advance

(P.S. I am aware that there are already scripts about creating views from a spreadsheet and then positioning them. I am just looking at a method of quickly applying a large number of Views I have created in Revit onto Drawing sheets)

---

<div class="post-metadata">

**Author:** ![matthew.smith](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@matthew.smith](https://forum.dynamobim.com/u/matthew.smith)\
**Post date:** [September 3, 2020, 3:46pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/2 "2020-09-03T15:46:37Z")

</div>

Being a new user I can Only Embed 1 Image at a time. Here is the Error message I am getting with the Nodes

I ![Node Error 2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/b/8b15d8affba8ad9f6faf3d7eb2b9b0756fa78820.jpeg) downloaded

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 3, 2020, 5:09pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/4 "2020-09-03T17:09:37Z")

</div>

Hi,

Replace the capital letter with lowercase letter to solve this issue and save the custom node.  
This problem comes from the fact that the reserved keywords (green inputs) are no longer supported in latest Dynamo 2.X versions.

New input = `views`

---

<div class="post-metadata">

**Author:** ![matthew.smith](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@matthew.smith](https://forum.dynamobim.com/u/matthew.smith)\
**Post date:** [September 4, 2020, 9:32am UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/5 "2020-09-04T09:32:32Z")

</div>

Thanks very much have got that working now.

---

<div class="post-metadata">

**Author:** ![matthew.smith](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@matthew.smith](https://forum.dynamobim.com/u/matthew.smith)\
**Post date:** [September 7, 2020, 1:50pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/6 "2020-09-07T13:50:34Z")

</div>

Ok so thanks to previous comments I have been able to update nodes where I was having the pervious error (Thanks @Alban_de_Chasteigner).

After more experimenting with these nodes still struggling to position my viewport centrally in the sheet. Have made some progress but still not completed it. See the snapshot below for the code I have created to position the viewport when on the sheet. Hopefully I am going down the right rabbit hole and any help people can provide would be greatly appreciated.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/0/40a62ca5f5add1e4f60f9cb3e76d4887d49b674b.jpeg)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 7, 2020, 3:17pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/7 "2020-09-07T15:17:19Z")

</div>

Try this instead :

 ![Place view on center of sheet](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/a/ca7a6f03f9feead6cf64ccc35531957fc5356fcf.png)  
 ![Place view on center of sheet2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/c/1c9356e13d2a12f1d09cd4247ca7e21ac7b66c1c.png)

[Place view on center of sheet.dyn](https://forum.dynamobim.com/uploads/short-url/10ipwbz047VpnBG6tRRDPGYVt5X.dyn) (14.4 KB)

---

<div class="post-metadata">

**Author:** ![matthew.smith](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@matthew.smith](https://forum.dynamobim.com/u/matthew.smith)\
**Post date:** [September 7, 2020, 3:48pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/8 "2020-09-07T15:48:26Z")

</div>

That is Fantastic thank you for your help. Now going to try and Stitch the two codes together.

---

<div class="post-metadata">

**Author:** ![matthew.smith](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@matthew.smith](https://forum.dynamobim.com/u/matthew.smith)\
**Post date:** [September 9, 2020, 11:54am UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/9 "2020-09-09T11:54:55Z")

</div>

@Alban_de_Chasteigner again thank you very much for the help you have provided with this dynamo code. Sorry to be a pain and ask again but I’m now looking at trying to expand the script out to cover all drawing sheets in my project (please see snapshot).

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/1/f1fbb08f87956b5fd677706852db6f46d9a271ff.png)

I was expecting an update to the code block but struggling to see why it’s falling down at the Annotation bounding box??

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [September 9, 2020, 1:29pm UTC](https://forum.dynamobim.com/t/position-viewports-on-drawing-sheets/54757/10 "2020-09-09T13:29:08Z")

</div>

There are probably some package conflicts or some nulls in the _Annotation BoundingBox_ node.

You can use the _ꟿ BoundingBox.MidPoint_ node instead. (Springs package)
