Revit .NET has provided the DockablePane API since version 2014. In this series of posts, we are going to explore the Revit DockablePane .NET API step by step.
In the first part, we created the simplest custom DockablePane to get the basic idea first about the DockablePane API. In this part, let’s enhance it a bit.
• Add the following block to the Page.xmal file. Please make sure the image file exists or change it to any available.
<Grid>
<Image Name="image1" Stretch="Fill" Source="c:\temp\RevitAddinPane.jpg" />
</Grid>
• Replace the TabBehind of the InitialState from PropertiesPalatte to ElementView as follows:
//data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.PropertiesPalette;
data.InitialState.TabBehind = Autodesk.Revit.UI.DockablePanes.BuiltInDockablePanes.ElementView;
That is about it. Now we can press the F5 key to give it a try in the Revit 2014 again, as chosen during the project creation time by Revit .NET Addin Wizard (RevitNetAddinWizard).
This time, the Page1 DockablePane will be hosted by the ElementView window directly.
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.