Practical Dynamo – Moving Views Based on Another View

Okay, so we’re on a roll with practical Dynamo usage. Last week we looked at placing views centrally on our sheets, but what if you didn’t want the view centrally placed? What if you wanted views placed in the same location on all sheets maybe in the top left of the page?

As always with Dyanmo, there is a solution for that. Again we’re going to be using the Rhythm custom node package to get the work done. This method requires one sheet to be used as a template that all the following sheets are based on.

In our example this time around, where we want the view located is in the top left (shown on the left) but by default Dynamo places our views in the bottom left (shown on the right)

 

This workflow can be easily integrated into our previous graph where we created new sheets in Dynamo using Excel however for this example we’re going to create a standalone graph. For this example though, it’s assumed that this time around though that you already have all the sheets and views required created.

 

First we start by taking all of our sheets, we do this simply by using Categories and then All Elements of Category, after that we get into our Rhythm nodes.

First we get a list of all of the viewports on our sheets using the Sheet.GetViewportsAndViews node. Run the list through a List.Clean node to remove the empty list entries. This leaves us with just the viewport entries.

Meanwhile, we also need to get the viewport from our template sheet. In this instance our template sheet will be drawing H101 which we’ll select using the Sheets node and then we’ll feed that node into the Sheet.GetViewportsAndViews node which are both from the Rhythm package.

And finally we feed our data lists into the Viewport.SetLocationBasedOnOther node, which again is from Rhythm. It’s as simple as that.

Hit the run button and watch the magic happen.

4 thoughts on “Practical Dynamo – Moving Views Based on Another View

  1. avatar Shawn Brennan says:

    Thank you for sharing these past 3 items. I think one of the next one’s could be an advanced version of this, where you’re filtering out sheets based on ‘Segment A’ and ‘Segment B’ for jobs that need 2 sheets for a single floor plan.

  2. avatar Brandon Schneiderhan says:

    Can you add a filter to this? For example, can I have it only move my plumbing sheet views and not my sketches?

  3. avatar Ryan Lenihan says:

    sure can, you just need to be able to use some kind of consistent logic to do the filtering. say for example a common sheet number or a common abbreviation contained within the view, or if you’re a single discipline per model you could even just filter by the type of view (floor plan vs. drafting view)

    i’ve put together a quick example of how you would filter based on the view types, the reason i’ve filtered like this is that there are floor plans in lists 0 and 4

    this same method would work for filtering based on view names or other parameters you could pull from the views.

Leave a Reply to Brandon Schneiderhan Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: