Application: GenerateFloor
Revit Platform: All
Revit Version: 2011.0
First Released For: 9.0
Programming Language: C#
Skill Level: Medium
Category: Elements
Type: ExternalCommand

Subject: Generate a floor using the closed outline made by a selection of walls.
Summary: 
This sample demonstrates how to generate a floor using the closed outline made by a selection of walls.

Classes: 
Autodesk.Revit.Creation.Document
Autodesk.Revit.DB.Floor
Autodesk.Revit.DB.FloorType
Autodesk.Revit.DB.Level

Project Files:                                
Command.cs
This is the main DLL source file. It contains the class Command which implements interface IExternalCommand.

Data.cs
This is the most important class of the sample project. Obtain all data for this sample: all possible types for floor, the level that walls based on.

GenerateFloorForm.cs
	A dialog that contains the following:
-	A drop-down list box contains all the floor types.
-	A check box shows whether the floor to be created is structural or not.
-	A preview window should display the closed outline.

Description:
-	The profile of floor can be retrieved from the location of walls. If this curve array is not in sequence, creating floor with this profile will encounter an exception. The solution is to arrange the curves in sequence first.
-	Before RevitAPI 10, the method ‘NewFloor’ is the only interface to create the object floor, slab, and foundation slab etc… From the RevitAPI 10, it is divided into three methods, “NewFloor”, “NewSlab” and “NewFoundationSlab”.

Instructions: 
1.	Select several walls that make a closed outline.
2.	Run this external command, a dialog will show you the profile of floor you want to create.
3.	Select the floor type you want to create.
4.	Click the OK button, the floor will be created.