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

Subject: Generate a 3D frame based on parameters read from UI or loaded from a data file.

Summary: 
This sample demonstrates how to read input data from UI to generate a 3D frame based on the first existing structural column, beam and isolated foundations which exist in the Revit Project. UI data could be saved to a data file and loaded during a second run of this extension.

REXSDK values: 
-	Read data from UI and use REX controls. 
-	Save data to file.
-	Load data from file.

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. For this sample 2 methods have been added to get from the Revit project levels and structural family symbols.  

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.
On this file are updated methods OnSetDefaults(), OnSave() and OnLoad(). 

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

Subcontrol.cs
	This file contains a SubControl generated by the wizard. This sub control hosts some controls initialized on the constructor. In addition 2 methods have been filled – SetDialog() and SetData().      

Description: 
This sample examines the current project and gathers information about structural elements (column, beam and isolated footing). Then, according the number of elements in X and Y direction and the spacing between them, a 3D frame is generated inside Revit. 
Data define via the UI could be saved and/or loaded via the extension menu.
Dimensions controls follow the Revit unit display formatting.  
   
Instructions: 
1.	Copy the module to the …Modules/Category directory
2.	Open Revit Structure.
3.	Open the project with 2 levels and as minima a structural beam, column and an isolated footing.  
4.	Run the Extension.
5.	Fill Edit boxes. 
6.	Generate the structure.