Application: NewPathReinforcement
Revit Platform: Structure
Revit Version: 2011.0
First Released For: 2008.0
Programming Language: C#
Skill Level: Medium
Category: Structure , Geometry
Type: ExternalCommand

Subject: Create PathReinforcement.
Summary: 
 This sample demonstrates how to create PathReinforcement by API.

Classes: 
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.Structure.PathReinforcement 
Autodesk.Revit.DB.Structure.PathReinforcementType
Autodesk.Revit.DB.Face
Autodesk.Revit.DB.Edge
Autodesk.Revit.DB.Solid
Autodesk.Revit.Creation.Document

Project Files: 
Command.cs
This file contains a class Command that implements the IExternalCommand, gets the selected wall or floor and creates PathReinforcement on it.

NewPathReinforcementForm.cs
This file contains a class NewPathReinforcementForm which inherits from Form, the function of this class is to display the selected Wall or Floor profile and let user draw path of PathReinforcement on it.

Profile.cs
This file contains an abstract class Profile which is derived by ProfileWall and ProfileFloor. Profile includes two methods Draw2D() and CreatePathReinforcement(), Draw2D() is used to draw profile on the form, and CreatePathReinforcement() is used to create PathReinforcement on the selected Wall or Floor.

LineTool.cs
This file contains a class named LineTool which provides some methods to draw lines on the form and store the data of drawn lines.

MathTools.cs
This file contains Verctor4 and Matrix4 two classes. These two classes are used to transform points between 3D and 2D.

Description: 
This sample shows user how to create PathReinforcement by 
NewPathReinforcement(PathReinforcementType, Element, CurveArray, bool) method:
-	Use Document.Create.NewPathReinforcementType() method to create one PathReinforcementType if there is no PathReinforcementType in current document.
-	Element here stands for the host of the PathReinforcement, a wall or a floor.
-	CurveArray stores the Path of the PathReinforcement.
-	bool value indicates the PathReinforcement lies to which side of Path.

Instructions: 
1.	Draw a Structure Wall or Slab (or open NewPathReinforcement.rvt) and select it.
2.	Run this command.
3.	Draw the path of PathReinforcement you want to create, user can click right mouse button to finish drawing.
4.	Click the “Preview” will preview the path reinforcement will be created.
5.	Select or unselect “Flip” check box to create PathReinforcement on the left or right side of the path which you drawn.
6.	Click “Create” button will create PathReinforcement when you finish the path.
7.	User can clean and redraw the sketch of path when click “Clean” button.