Delete Unused Views Revit Macro – Arch Smarter

13 Mar

Delete Unused Views Revit Macro – Arch Smarter.

This macro (in Revit 2014 and 2015 versions) deletes all views in the current project that are not on a sheet or are not named with the specified prefix. The macro works with all views, including dependent views. It does not delete legends and schedules.

The macro starts by getting all the views in the current model file. It then loops through the views and checks if the view is placed on a sheet. If the view is not on a sheet, the macro checks if the view name has a particular prefix. In this example, it checks for views beginning with “working”. Note that you can edit the code to use any prefix you want – just change the value of the “viewPrefix” variable as shown below.

Delete views with this Revit Macro_code - view prefixIf the current view does not have the prefix and is not on a sheet, it can be deleted. The macro adds the view to a list of views to delete. Once all the views have been checked, the macro goes through the list of views to delete and removes each one from the model file.

Once all the clean-up is done, the macros displays the list of the views that have been deleted.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: