Moving view ports on a sheet

Hi, everyone here.
As per the project now, we have created a dynamic script that places the views on the sheet, copies the placed sheet with the views, and then raises the viewport to see the level elements above it.

But the problem is that if you activate Dynamo, it moves up the views from the sheet in (height / 100) so after I activate Dynamo, I have to move the views together by (height / 100) , what’s the problem with the script I made?
Or can we add a script that’s the height /100 to raise the view after raising it?

The explanation is a little complicated, so it will be helpful to understand the attached picture.

Thank you for your attention.


Viewports are placed relative to model space, so if their crop moves up, the viewport will stay in the same position but it’s view will move up in the viewport itself.

The best way to work around this is to get the view’s viewport that changed when updating the view, then move it back down by the height / scale. This can be done using the Get/Set BoxCentre() methods for viewports. To get a views viewport is generally harder, but can be done using the viewport/view class and filtering through to find the one with the view.

Thank you Gavin,
I have tried with the viewrpots.setboxcentre as the image below but it does nothing.
It seems the node is functioning but the views still moves up as before.
Can you have a look at it please?

My guess is you’ve got a race condition going here, the crop probably happens after the viewport change. Try using a passthrough to get the viewport assessment to happen after the view re-crop. Beyond that not 100% sure, you could try deleting the viewport after than placing it at the same location again maybe so it will be corrected assuming the view extents change.

Hi Gavin, thanks for the idea.

I have tried as your suggestion but it didn’t work. in fact it seems viewport setbox centre node is not working. I have tried it alone after froze the other nodes but it didn’t do anything with not even an error sign.