Remove/Replace Viewport on Sheet

These nodes do not allow for the removal of a viewport from a sheet. I am looking for an implementation of the ViewSheet.DeleteViewPort() from the API.

…could possibly be done with Element.Delete from Archi-Lab Grimshaw, for instance

Ok. I have succeeded in extracting the views from the respective sheets and the points where the view was placed. Now I have removed the view using Element.Delete. When I read in the previous element ID of the view and attempt to replace it on the sheet from which it was removed I get the message from Tool.PlaceViewsOnExistingSheets that the view is already placed. I have restarted Dynamo and Revit between deleting the view from the sheet and the script to replace the view.
Any ideas?

I have updated the script to use the View Name instead of the ID. No change. Tool still returns the view is already placed.

I can’t imagine any simple solution to this issue. Maybe bimorph.DuplicateSheets from BimorphNodes would help. Here is also a thread concerning ID’s:

You might want to try Clockwork’s passthrough node. It allows the output to be executed after the waitFor input.

Jesse -

I’ve got the following script to run. Note the directions in the pink group, I had to disconnect the element delete node to populate views and coordinates then reconnect to run. If you have Dynamo player you can create a step 1 and step 2.

Good luck!

@blazzeri Could you please upload image again. It is not readable. Thanks :slight_smile:

Just added two shots zoomed in. Thanks!

1 Like

@blazzeri The script worked on the project in question with the exception the views replaced were not in the original position from where they were removed by the Element.Delete. The key notes did repopulate.

Did the View.ViewPort Box Center node populate coordinates?

Yes, the views were populated and the ViewPort Box Center has coordinates

We’ve been having the same issue with key values disappearing from the view and schedule.
I’ve noticed that adjusting the crop region, modifying the view range, and even hiding/unhiding elements seem to “refresh” the view and allow the keynotes to repopulate.

Just something to keep in mind.

Hmm… mine are not having that issue. Are you running the script in the two part series? I was only able to get it to work if I ran the coordinates and views first and delete/replace views second.

Nick, I think you are right. We are only having this issue with cropped dependent views. Do you have any Dynamo solutions for adjusting crop regions or view ranges to help streamline this “refresh” process?

Thank you!

A quick solution, if your dependent views are using scope boxes, is to try adjusting the scope boxes manually so all dependent views are forced to refresh.

As for Dynamo solutions - I’ve tried a few different angles. The problem is that they all can take a while when running on a larger projects because it’s just a brute force approach at that point. I started out hiding then unhiding grids in all placed views. I then moved on to adjust view range (and again moving it back) which seemed to be a little quicker. You’ll have to find what works best for you, but there definitely are options.

I have found that unchecking then rechecking the Crop View box works only if the sheet is open. Same goes for View Range. I’ve got all of my view ranges controlled by a view template, when I change the template it will only “refresh” the sheets I have open.

Looks like I misspoke before, my current solution is to hide the keynotes in each view and unhide them again. This seems to work with closed views too.

1 Like

Here my script to replace views on sheets

1 Like