Position Viewports on Drawing Sheets

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

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)

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

INode Error 2 downloaded

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

2 Likes

Thanks very much have got that working now.

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.

Try this instead :


Place view on center of sheet.dyn (14.4 KB)

2 Likes

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

@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).

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

There are probably some package conflicts or some nulls in the Annotation BoundingBox node.

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