Application: PathOfTravel
Revit Platform: Architecture
Revit Version: 2020.0
First Released For: 2020.0
Programming Language: C#
Skill Level: Medium
Category: Elements, Annotation, Views
Type: ExternalCommand

Subject: Create PathOfTravel.
Summary: This sample demonstrated how to create PathOfTravel elements from room(s) to door(s) in a plan view.

Classes:
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.Creation.Document
Autodesk.Revit.DB.Analysis.PathOfTravel
Autodesk.Revit.DB.Architecture.Room
Autodesk.Revit.DB.Architecture.Door

Project Files: 
Command.cs
It contains the class Command which inherits from interface IExternalCommand and implements the Execute method. Execution displays the dialog defined in CreateForm.cs.

CreateForm.cs
This file contains a Form class which consists three radio controls which allow three different PathOfTravel creation methods.

Description: 
This sample provides following functionalities.
-	Automatically computes room center and corner points to use for the start point of the path.
-	When the option for path to a single door is selected, lets the user pick which door to use for the end point of the path.
-	Automatically creates PathOfTravel elements between the selected combination of room and door elements.

Instructions: 
Open Revit application and execute the command.
1.	Create some rooms and exit doors.
2.	Open a plan view in which the created elements are visible.
3.   Execute the external command. In the dialog, pick an option to create the paths. After clicking OK, the paths will be created and displayed in the view.