Application: BoundaryConditions
Revit Platform: Structure
Revit Version: 2011.0
First Released For: 9.1
Programming Language: C#
Skill Level: High
Category: Structure
Type: ExternalCommand

Subject: Create or retrieve boundary conditions.
Summary: 
This sample shows to get BoundaryConditions’ parameters or create BoundaryConditons.

Classes: 
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.BoundaryConditions

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

BoundaryConditionsData.cs
This file contains class BoundaryConditionsData which prepares the needed data (the selected element type and its BC information) and creates BoundaryConditions.

BCProperties.cs
This file contains three enumerations (BCType, BCState and BCTranslationRotation) and two classes (BCTypeAttribute, BCProperties). They prepare data for the PropertyGrid which is contained in BoundaryConditionsForm.

UnitConversion.cs
This file contains a structure ConversionValue and a class ConversionValue. The structure defines the conversion rule between display value and internal value. The class is a value conversion dictionary, which stores some units and their corresponding ConversionValue.

Description: 
-	Only select one structure element.
-	If the selected element has boundary conditions the parameters of the boundary conditions (BC) are presented. And users are also allowed to set these parameters with other valid values.
-	List all the Ids of BC whose host is the selected element in a list box.
-	According to the selected BC Id, the relevant BC Type, State and X, Y, Z translation/rotation will be displayed.
-	User is not allowed to change the BC Type.
-	User can set the State of BC to Fixed, Pinned, Roller or User (When different values are selected the X, Y or Z translation/rotation should do corresponding changes according to the Revit main program UI). 
-	If the User is selected as the current State, then X, Y or Z translation/rotation can be set to Fixed, Released or Spring.
-	If Spring is selected for X, Y or Z translation/rotation, positive values can be inputted as the Spring Modulus (Show the unit of the value for users).
-	If the selected element does not have a BC then create one.
-	Set the BC Type to Point, Line or Area according to the selected element. (Beams/Walls/ Wall Foundations have line BC; Columns/ braces have point BC; Slabs/Foundation Slabs have area BC)
-	Other initial parameters are set to be fixed.
-	The user can change all the parameters values except the BC Type (refer to the details of last point)
-	When the user clicks the OK button the existing BC is updated or the new BC is created.
-	We should use NewPointBoundaryConditions, NewLineBoundaryConditions and NewAreaBoundaryConditions methods of Autodesk.Revit.Creation.Document to create BC

Instructions: 
1.	Open Revit Structure and draw a beam.
2.	Select the beam and run the sample.
3.	Select the property value in the PropertyGrid control in Form.
4.	In sample’s main UI click the OK button.
5.	Return to Revit main program you can see a line BoundaryConditions is created on the selected beam.

Others:
-	We provide four additional files (Boundary Conditions Pinned.rfa, Boundary Conditions Fixed.rfa, Boundary Conditions Roller.rfa, and Boundary Conditions User.rfa). They are family files of Boundary Conditions. If you cannot draw any Boundary Conditions, pleas load these families first. And then setting the Family symbol for Boundary Conditions in Setting menu->Structural Settings->Boundary Conditions Settings.
-	Only The following structural elements can have BC:
Columns/braces/Isolated Foundations/ Beams/Walls/ Wall Foundations/ Slabs/Foundation Slabs