Application: NewOpenings
Revit Platform: All
Revit Version: 2011.0
First Released For: 2008.0
Programming Language: C#
Skill Level: High
Category: Elements
Type: ExternalCommand

Subject: Create openings.
Summary: 
Shows how to create Openings by Revit API.

Classes: 
Autodesk.Revit.Creation.Application
Autodesk.Revit.Creation.Document
Autodesk.Revit.DB.Wall
Autodesk.Revit.DB.Floor
Autodesk.Revit.DB.Opening
Autodesk.Revit.DB.XYZ
Autodesk.Revit.DB.Edge

Project Files: 
Command.cs
This file contains a class Command that implements the IExternalCommand, the function of it is to show the main Form.

NewOpeningsForm.cs
This file contains a class NewOpeningsForm. The function of this class is to display the selected Wall or Floor profile and to draw geometry on it.

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

ITool.cs
This file contains an Abstract class ITool which derived by ArcTool, NullTool, RectTool, CircleTool, LineTool. They are used to draw various geometries on NewOpeningsForm.

MathTools.cs
This file contains Verctor4 and Matrix4 two classes. These two classes are used to transforming points from 3d to 2d.

Description:
This sample use Document.NewOpening method to create opening on the selected Wall or Floor. The profile can be created by NewCurveArray, NewArc and NewLine methods of Application.
	
Instructions: 
1.	Select a wall or a floor.
2.	Run the command.
3.	Draw the opening profile on the preview panel. Click the mouse middle key to switch tools 4. to draw line, rectangle, arc and circle.
4.	Click “Ok” button, opening will be created on wall or floor.