Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66683

Re: Delete All Drafting Views

$
0
0

Here you go

Create a macro module and paste this

 

		public void DelAllDraftView()
		{
			Document doc = this.Document;
			List<ElementId> L = new FilteredElementCollector(doc).
				OfClass(typeof(View)).ToElements().Cast<View>().
				Where(x=>x.ViewType==ViewType.DraftingView).
				Select(y=>y.Id).ToList();
			using( Transaction t = new Transaction( doc ) )
			{
				t.Start( "Deleting DraftingViews" );
				doc.Delete(L);
				t.Commit();
			}			
		}

Make sure that a drafting view is not an active one before starting the execution of macro


Viewing all articles
Browse latest Browse all 66683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>