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

Re: Isolate elements on a newly created view

$
0
0

Ok, so the internal version of Revit still has this "issue", lets hope you guys can track it down.

 

Thanks for the work around, i tried two transactions as well before, but it didn't work. The trick is as you guys described to set the active view to the new created view.

 

Here is the snippet for those interested:

 

 

		public void testTwo()
		{
			View newView;
			using (Transaction t = new Transaction(this.Document))
			{
		       	        t.Start("Trans");
				// Get Floorplan for Level1 and copy its properties for ouw newly to create ViewPlan.
				View existingView = this.Document.GetElement(new ElementId(312)) as View;
				// Create new Floorplan.
				newView = this.Document.GetElement(existingView.Duplicate(ViewDuplicateOption.Duplicate)) as View;
				t.Commit();
// important to set new view as active view. this.ActiveView = newView; t.Start("Trans 2"); // Try to isolate a Wall. Fails. newView.IsolateElementTemporary(new ElementId(317443)); t.Commit(); } // Change the View to the new View. this.ActiveView = newView; }

 

It somewhat sucks having to commit twice and therefore having to regenerate twice. But the workaround is solid and does the job, thanks guys!

 


Viewing all articles
Browse latest Browse all 66662

Trending Articles



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