Problems with recreating view crop boundaries and sheet viewports from link into host

My goal here is to set up sheets in an MEP model that very similarly match those in a linked architectural model. The reason is to develop uniformity across the drawing sheets of an entire project. I know there are in-process projects by others on this topic, but I remain bound and determined to keep trying myself.

I’m trying this by the method described by @Nick_Boyts, in a previous posts on the topic:

I’ve successfully been able to get the crop boundaries from views and viewports from sheets in the linked model, recreate those same boundaries applied to new views in the host model and place them on sheets by recreating the viewports.

Problem #1 - there is a very slight translation in the coordinates of the crop boundaries, as shown here:

Problem #2 - there is a very slight difference in the viewports too, as shown here:

Any insight on why this may be happening would be greatly appreciated! Thanks!

Do both models have the same levels at the same elevations and also share the origin? If the only change is Z, makes me think it’s a level thing.

I will have to check on the origins, but all the levels are the same in the host as in the link, including the elevations.

Viewport placement also depends on the location of the title block. You would hope that everybody’s TB is located at 0,0 in the sheet view, but that may not be the case. You may have to automate matching the TB location for each sheet as well.

@JustinStirling: I am also trying to match sheets from a linked model. I am curious if your issue could be caused by the same issue that I am having:

The location of the viewport is determined by a bounding box that is NOT equal to the view crop boundary. This bounding box is drawn around annotations that may extend outside of the view crop boundary (such as grids, or tags). Perhaps there are annotations in your architectural link that are affecting the bounding box?

Here is an example from my current project. I run a dynamo script that measures the location of all viewports in the project. Then, the viewports are moved by the same vector, except negative. I expect the two views on this sheet to return to the origin and appear directly on top of each other because they have identical view crop boundaries. However, this is what I get:

Because there is a tag that extends way outside of the view crop boundary, the viewports’ MinPoints are not identical. This can also be caused by grids.

I have no idea if this is causing your problem, but I suppose it is something to check. Annotations from the arch model could be causing the viewport bounding box to change size when you copy the view to your model (because I’m guessing you don’t also copy their annotations). The box center wouldn’t appear to be altered if the copying method is based on the center of the bounding box.

@Frank_Loftus, thanks for explaining your issue and bringing this to my attention. This idea has been shelved for a while since I couldn’t get it figured out. I’ll try to resurrect my script and see if I can figure out where I left off. Thanks again, I’ll report back my findings!

I have seen folks turn off all annotations, get the points, then set the box center. I have also solved it by using the boundingbox of the view and not Viewport. Then use the U and Band 0z to set the Viewport location. This may still not be 100% accurate but usually VERY close if you don’t have major rogue annotations like the example above.

@SeanP, any chance you could elaborate a little on the “turn off all annotations” approach?

I’m guessing I need to:

  • get the view in the linked model I want to try and recreate - I can do this easily.

  • turn off all annotations in the linked model view - I do not know how to do this

  • get the bounding box curves (or scope box) of the linked model view and apply to new view in host model - I can do this

  • turn off all annotations in the host model view - I do not know how to do this

  • get the bounding box curves and center point of the viewport on the linked sheet so the viewport can be recreated in the host model - I can’t say I’ve figured this out yet either.

Part of my problem might solely be in the terminology I’m using…and how incorrect it is.

Any help would be greatly appreciated! Thank you!

So, I don’t think I was following at first as you can’t do any modifications to a linked model without actually opening it. So, this is code that can do it, but it will not work on a straight linked doc.

for cat in doc.Settings.Categories:
    if cat.get_AllowsVisibilityControl(view):
        if cat.CategoryType == CategoryType.Annotation:
            view.SetCategoryHidden(cat.Id, True)

@SeanP , you mentioned a method of using the bounding box of the view instead of the viewport. Can you elaborate on that? That would eliminate the need to turn off annotations in the linked model, right?

Such a method would really help me as I’m trying to locate views on a sheet regardless of any annotations that may be enlarging the bounding box.