Application: PyramidGenerator
REXSDK Version: 2018.0
First Released For: REXSDK 2012
Last Modified: 01/07/2016
Modified By: Autodesk
Programming Language: C#
Skill Level: Medium 

Note: For more information about this sample please read the “Pyramid Generator – Tutorial.pdf” provided with SDK. It shows the whole process of the Extension module creation step by step.

Subject: Generates a pyramid structure made of beams. 

Summary: 
This sample demonstrates how to create an Extension module based on the WPF technology. The module generates a pyramid structure made of beams. The size of a pyramid is determined by the width and the height parameters. 

REXSDK values: 
-	Create the REX extension module in WPF technology with a multi layout dialog.
-	Use the REXUnit system to present data formatted according Revit settings.
-	Use the REX Extension Progress.
-	Use the REXEditBox for unit dependent data.
-	Use the REXUnitEditBox for unit dependent data.
-	Use the REX serialization system.

Project Files: 

Generated by the wizard:

Extension.cs:
The main class generated by the wizard. It contains definition of the Extension class which is the main class in the REXExtension module. This class is a central point which allows user to manage and customize the module.

ExtensionRevit.cs:
This file contains an ExtensionRevit class. This class allows to separate general functionality (provided by the Extension class) from functionality characteristic for the Revit context e.g. setting layouts may be done in the Extension class but reading Revit elements should be carried out in the ExtensionRevit class (unless the specific layout is set only in the Revit context). In the current example the ExtensionRevit class: reads Revits selection, creates the pyramid based on the parameters.

Data.cs
This file contains a Data class which is a data container accessible from different places in the module. All common objects should be placed in this class.

Application.cs, DirectAccess.cs, Results.cs, Settings.cs
These files were generated by the wizard but there is no need to make any changes in their content.

Added manually:

PyramidNoteControl.xaml, PyramidNoteControl.xaml.cs
These files contain a definition of the note control.

PyramidParametersControl.xaml, PyramidParametersControl.xaml.cs
These files contain a definition of the layout which presents current parameters of the pyramid and allows for theirs modification. 	

IPyramidGenerator.cs
This file contains a definition of the IPyramidGenerator interface for communication with external module.

Description: 
This sample generates a pyramid structure made of beams. The size of the pyramid is determined by the height and width parameters. All parameters are set on the first layout. The second one presents current settings as an HTML report. The set of parameters may be saved in a file and loaded from it as well. The structure generated in Revit may be modified, by launching the module with a proper selection. The PyramidGenerator Extension is also prepared to exchange data with other modules by the IPyramidGenerator interface.

Instructions: 
1.	Open Revit.
2.	Launch the module.
3.	Define all parameters.
4.	Click the OK button.
5.	Application will create a Pyramid structure.