Placing views on top of other views - Can't get them to line up exactly

I’ve searched the forums for this, but as far as I can tell no one is having the same issue as me.
This thread here is the closest I’ve found, but it’s not quite the same: https://forum.dynamobim.com/t/place-multiple-views-on-multiple-sheets-by-coordinates/12883/76?u=bac

I’m trying to place views on top of existing viewports. The existing viewports are demolition views and the views I’m trying to place are existing room name views (they are just room tags of the existing rooms with nothing else on the view). Each corresponding view has the same scope box as the viewport it is being placed on top of.

The workflow is:

  1. Find the center of the existing viewport
  2. Place the existing room name view on top of that viewport in the same location.

This is what I thought I’ve done, but every time I run it the existing room name views are slightly off-center to the left of the original views. The vertical position is correct. Am I doing something wrong when finding the center of the existing viewport?

Ignore all the frozen nodes off to the right. I’ll refine that and get it to set the viewport types after I’ve fixed this issue.

Place existing room name views on sheets v2.0.dyn (69.3 KB)

Hey, Rhythm also has a node Viewport.SetLocationBasedOnOther… does that help?

I suspect that annotation crop might impact it…

Thanks for the suggestion, but that node didn’t solve the issue. Annotation crop may be impacting it, I’m not sure honestly. The existing room name views all have the same crop region/scope box as the view they will be overlayed on.

Perhaps you could post a sample rvt and updated dyn and perhaps that will help us work out what’s wrong?

There’s a method for getting and setting the viewport centre… http://www.revitapidocs.com/2019/71734b96-6582-e6c5-674a-e6c092ced0f2.htm the node probably uses those.

Just wondering if your files maybe have different origins? Whether that could affect it?

Some discussion here might be relevant… Views Position on Sheets with Scope Boxes

All I’ve found so far is this post - https://thebuildingcoder.typepad.com/blog/2013/08/setting-the-exact-view-location-on-a-sheet.html

There’s a comment down at the bottom that points out that view origins are different. So maybe that’s the problem? I have no idea how to incorporate his solution though.

Are you able to share a minimal RVT? That would help isolate your specific issue.

I can make a dummy RVT to recreate the problem later today possibly. I have looked into this more just by looking at viewport properties and I’m not sure if I’ll be able to solve it. I recreated the process, but did everyting manually:

  1. Duplicate a view
  2. Rename the view by adding a suffix
  3. Place the duplicated view directly on top of the existing view on a sheet.

Then I observed the properties of the views and viewports using “Viewport.LocationData”. The properties don’t match even when the views are aligned on the sheet. Maybe it has something to do with how views are duplicated in Revit. I’m not sure how I would be able to get those coordinates without first aligning the views manually.

With or without detailing?

Without, and not as a dependent. Just normal duplicate.

I am thinking that is your problem. There is some kind of annotation element in your original view that is resulting in the ViewPort’s Box center being different.

To summarize:
For viewports we have to use something called “ViewPort Box Center” that is essentially the centroid of the bounding bax that circumscribes all of the elements in the view.

When you duplicate without detailing, I bet you are tossing out something in the new view and not realizing it. Or the crop region (maybe annotation) is changing between the duplicate in your file, I have no way of knowing this at the moment.

I followed your exact steps in a completely blank file

  1. File New > No Template (Imperial)
  2. Draw walls to have something in the view “Level 1”
  3. Duplicate the view (without detailing since I have no detailing in theview)
  4. Place both views on a sheet manually
  5. Aligned them with Viewport.SetLocationBasedOnOther

And I receive exactly aligned views.

image

In order to efficiently troubleshoot what you have going on, we absolutely need a sample file from you that demonstrates what you are running into. Recreating the steps myself yielded expected results, so that is our only option.

2 Likes

Okay I’ll work on getting together a sample file when I can. I appreciate you going through all that effort. I’ll also quickly try duplicating with detailing and see if that fixes the issue.

1 Like

I’m back a few days later to update this post:

My issue was the annotation crop. I changed the order my script worked to get things working. My order of operations before was:

  1. Duplicate views.
  2. Apply an “Existing Room Name Views” view template.
  3. Tag rooms and attempt to place views on sheets.

This method didn’t work because when I applied the “Existing Room Name Views” view template, it was set to remove all existing detailing and only include existing rooms from the linked Architecture model. When that happened, it changed the size of the view, so the views could no longer be lined up by placing their centers on top of each other.

The new (working) process is:

  1. Duplicate views with detailing.
  2. Place new views directly on top of the views that were duplicated.
  3. Then apply the view template and manipulate the views/viewports however needed. Thank you @john_pierson for your help.
2 Likes

Woohoo! :raised_hands:

Glad to hear you got it worked out. Thanks for reporting back as well. This helps others who may run into this find out the solution!

:+1:

1 Like