Application: SlabProperties
Revit Platform: Structure
Revit Version: 2011.0
First Released For: 9.0
Programming Language: C#
Skill Level: Beginning
Category: Parameters, Elements
Type: ExternalCommand

Subject: Slab properties retrieval.
Summary: 
This sample demonstrates how to get Slab’s properties which consist of Level, Type Name, Span Direction and Slab’s Layers information (Material Name, Thickness, Young Modulus X, Y and Z).

Classes: 
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.Floor
Autodesk.Revit.DB.Structural.CompoundStructureLayer
Autodesk.Revit.DB.Structural.CompoundStructureLayerArray
Autodesk.Revit.DB.BuiltInParameter

Project Files: 
Command.cs
This file contains the class Command which inherits from IExternalCommand interface and implements the Execute method; besides, the class implements all functionalities of getting relevant properties of Slab.

SlabPropertiesForm.cs
This file contains a Form class which consists of three TextBox controls for showing Level, Type Name, Span direction of Slab respectively; a RichTextBox control will show all the Layers information of Slab.

Description: 
This sample uses Structural and Parameters classes mostly to implement the functionality of getting Slab’s properties which consists of Level, Type Name, Span Direction and all Layers information (Material name, Young Modulus.
-	Slab objects can be gotten from ActiveDocument.Selection.Elements.
-	Floor.Level.Name, Floor.FloorType.Name and Floor.get_Parameter(BuiltInParameter.FLOOR_PARAM_SPAN_DIRECTION) can be used to get the Level, Type name and Span direction of Slab respectively.
-	Floor.FloorType.CompoundStructure.Layers can be used to retrieve the Structure Layers collection of Slab.
-	CompoundStructureLayer class’s Thickness, Material properties and get_Parameter() method can retrieve the thickness, material and the young modulus of Slab.
-	Use BuiltInParameter.PHY_MATERIAL_PARAM_YOUNG_MOD1, PHY_MATERIAL_PARAM_YOUNG_MOD2 and PHY_MATERIAL_PARAM_YOUNG_MOD3 to retrieve the X, Y, Z Young Modulus respectively. 

Instructions: 
1.	Start Revit, draw a Slab, and then define some relevant parameters (such as Level, Material) for this new Slab. One .rvt file named SlabProperties.rvt is available under sample project folder, material and layers have been added, you can open this file and select the existing floor to run the sample. 
2.	Select this Slab and click the extern command, Slab properties form will be popped up: Level, Thickness, Span direction and all Layer properties for selected Slab will be showed in TextBox and RichTextBox controls of this Form.