Revit .NET has provided the PreviewControl API since version 2013. In this series of posts, we are going to explore the Revit PreviewControl .NET API step by step.
Before, we created the simplest custom PreviewControl to get the basic idea first about the PreviewControl API. At that moment, we previewed the first view that was filtered out by the Revit API. Now, let’s see how to preview the active view of the current document.
It’s very simple, replacing the win.grid1.Children.Add call with the following:
win.grid1.Children.Add(new PreviewControl(CachedDoc, CachedDoc.ActiveView.Id));
That is about it. Here is what the WPF window looks like when the command is running.
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.