Set viewport center

I am trying to align viewport centers but since there are differences in annotations, they end up slightly misaligning. I tried to compensate by substracting the difference in sizes and then translating the center point of the sheets to move the viewports to but no succes.
This is because the sizes don’t expand away from centerpoint themselves. Sometimes they are bigger on the left, other times bigger on the right etc. I am using scope boxes on those floorplans and they have exactly the same crop size. But setting them to the cropbox middles doesn’t work either because they are on a different coordinate system.

So I am running out of ideas to allow my views to perfectly align, based on the biggest of the view in the same ‘scope box series’ to be centered on the sheet.

Anybody else ever run into this problem?

The way I have solved this is with using temporary transactions and turning off ALL annotations. Getting the Center Point, turning them all on and then finding the translation between the current center, the center with no annotations, and then location you want it to be in. Often you can get away with first and last in that sequence.

I had this idea as well but this increases load times significantly. And if someone uses this then they have to make sure the template won’t block things to not be filtered off

Actually I tested it and indeed used the Temporary Category Hide function. (Clockwork package had a nice node for this). Now I save time in the script because the viewport boundingbox doesn’t have do be drawn in order to get its size. So sure it’s not the fastest script but it seems very reliable and quick nonetheless.

I pre-filter on views that have scopeboxes assigned to them. If they don’t then I do get the viewport size to determine whether they are too big for the sheet or not

1 Like