RevitAPI Samples Readme
This document provides an overview of the sample applications that come with RevitAPI for .NET developers. Whether you are new to RevitAPI or relatively experienced with it, the sample applications can be a source of ideas and an opportunity to learn new concepts. In addition to describing what each sample application does, this document gives tips on building samples and explains the sample categories, lists the skill level required to understand each application, and provides a suggested order in which to go through the sample applications.
The samples projects use references to dlls in Revit's default installation folders.
- C:\Program Files\Autodesk\<Revit_Version>\Program\RevitAPI.dll
- C:\Program Files\Autodesk\<Revit_Version>\Program\RevitAPIUI.dll
- C:\Program Files\Autodesk\<Revit_Version>\Program\RevitAddInUtility.dll
- C:\Program Files\Autodesk\<Revit_Version>\Addins\CivilAlignments\Autodesk.CivilAlignments.DBApplication.dll
- C:\Program Files\Autodesk\<Revit_Version>\Addins\SteelConnections\ASCADLinkMgd.dll
- C:\Program Files\Autodesk\<Revit_Version>\Addins\SteelConnections\ASGeometryMgd.dll
- C:\Program Files\Autodesk\<Revit_Version>\Addins\SteelConnections\ASObjectsMgd.dll
- C:\Program Files\Autodesk\<Revit_Version>\Addins\SteelConnections\Autodesk.SteelConnectionsDB.dll
- C:\Program Files\Autodesk\<Revit_Version>\Addins\SteelConnections\DotNetRoots.dll
To build all the samples, all these files must exist. If you install Revit in a non-standard place, you can use any of the following solutions:
- Copy the required dlls to the default installation locations described above.
- Open the *.targets files and fix each <HintPath> for the dlls. The *.targets files found in "C:\<Revit_SDK_Version>\Samples\VSProps\".
The RevitAPI sample applications are grouped into subdirectories according to the major focus of the sample code. The subdirectories and descriptions of the corresponding categories are listed below.
Basics
The category Contains samples related to the ExternalCommand framework, transactions, and event registration.
Geometry
Contains samples related to read and analysis of element geometry including curves and reference planes.
Parameters
Contains samples related to creation, modification and read of element and shared parameters.
Elements
Contains samples related to Revit basic elements such as walls, roofs, floors, levels, grids.
Families
Contains samples related to family creation and family instances.
Materials
Contains samples related to materials and units.
Annotation
Contains samples related to annotations such as notes, detail curves, dimensions and tags.
Views
Contains samples related to view creation and view properties.
Rooms/Spaces
Contains samples related to rooms, spaces and areas.
Data Exchange
Contains samples related to import, export, or print of Revit documents.
MEP
Contains MEP-specific samples.
Structure
Contains structure-specific samples.
To help you identify where to start and what skill level you need to understand a particular sample application, this document lists a skill level rating for each sample. The four levels, beginning, medium, high, and advanced, are characterized by the specific RevitAPI development skills described below.
Beginning
At this level, the developer has an understanding of the RevitAPI database and knows most of features that RevitAPI provides.
- How to use External Command.
- How to retrieve data.
- How to modify data.
- How to delete objects.
- How to create objects.
- How to use toolbars.
- How to control element visibility.
Medium
At this level, the developer knows how to:
- Control visibility of elements.
- Deal with RevitAPI events.
- Create complex objects.
- Obtain data from complex objects.
- Print views.
- Use transactions.
High
At this level, the developer knows how to:
- Get and preview geometry information using graphics GUI (Windows forms).
- Create objects using graphics GUI (Windows forms).
- Deal with more complex objects.
Advanced
At this level, the developer knows how to:
- View all elements' geometry information.
- Interact with the database.
EnergyAnalysisModel
AutoTagRooms
CapitalizeAllTextNotes
CivilAlignments
ColorFill
CreateDimensions
DeleteDimensions
DimensionLeaderEnd
InCanvasControlAPI
PathOfTravel
SpotDimension
TagBeam
APIAppStartup
AutoStamp
AutoUpdate
CancelSave
CapitalizeAllTextNotes
ChangesMonitor
CloudAPISample
Custom2DExporter
DeleteDimensions
DeleteObject
DesignOptionReader
DisableCommand
DuplicateGraphics
ErrorHandling
EventsMonitor
HelloRevit
InCanvasControlAPI
Journaling
ModelessForm_ExternalEvent
ModelessForm_IdlingEvent
PhaseSample
PlacementOptions
PostCommandWorkflow
PrintLog
ProgressNotifier
ProjectInfo
ReferencePlane
RevitCommands
Ribbon
RotateFramingObjects
RvtSamples
SelectionChanged
TransactionControl
UIAPI
Units
VersionChecking
WorkThread
ArchSample
DWGFamilyCreation
ExportPDFSettingsSample
ExternalResourceDBServer
ExternalResourceUIServer
ImportExport
PanelSchedule
Units
ViewPrinter
AttachedDetailGroup
CivilAlignments
CompoundStructure
ContextualAnalyticalModel
CreateFillPattern
CreateTrianglesTopography
CurtainSystem
CurtainWallGrid
DatumsModification
DesignOptionReader
DisplacementElementAnimation
DuplicateViews
ExportPDFSettingsSample
ExtensibleStorageManager
ExtensibleStorageUtility
FoundationSlab
GenerateFloor
GetSetDefaultTypes
GridCreation
LevelsProperty
ModelLines
MoveLinear
MultistoryStairs
NewHostedSweep
NewOpenings
NewRoof
Openings
PathOfTravel
PerformanceAdviserControl
ShaftHolePuncher
SharedCoordinateSystem
Site
SlabProperties
SlabShapeEditing
SpanDirection
StairsAutomation
ViewFilters
WinderStairs
AutoParameter
CreateAirHandler
CreateTruss
DividedSurfaceByIntersects
DWGFamilyCreation
FamilyParametersOrder
GenericModelCreation
GetSetDefaultTypes
InPlaceMembers
NewForm
PlaceFamilyInstanceByFace
PlacementOptions
RevitCommands
SinePlotter
TypeRegeneration
TypeSelector
ValidateParameters
WindowWizard
AnalyticalViewer
AutoJoin
BRepBuilderExample
ComputedSymbolGeometry
ContextualAnalyticalModel
Custom2DExporter
DirectionCalculation
DistanceToPanels
DistanceToSurfaces
DuplicateGraphics
DynamicModelUpdate
ElementViewer
FindColumns
FreeFormElement
GeometryCreation_BooleanOperation
ManipulateForm
MaterialQuantities
MeasureHeight
MeasurePanelArea
MultithreadedCalculation
NewPathReinforcement
PanelEdgeLengthAngle
PointCloudEngine
PointCurveCreation
ProximityDetection_WallJoinControl
RayTraceBounce
ReferencePlane
RevitViewer
RoomViewer
ShaftHolePuncher
SinePlotter
SlabShapeEditing
SolidSolidCut
SpatialFieldGradient
Truss
UpdateExternallyTaggedBRep
ParameterValuesFromImage
AppearanceAssetEditing
MaterialProperties
PhysicalProp
AutoRoute
AvoidObstruction
FabricationPartLayout
PowerCircuit
RoutingPreferenceTools
TraverseSystem
AutoParameter
BeamAndSlabNewParameter
BrowseBindings
CreateBeamsColumnsBraces
CreateShared
DeckProperties
FamilyParametersOrder
FireRating
InvisibleParam
MoveLinear
ParameterUtils
PhysicalProp
ReadonlySharedParameters
SlabProperties
SpanDirection
TestFloorThickness
TestWallThickness
VersionChecking
ViewTemplateCreation
AddSpaceAndZone
DoorSwing
RoofsRooms
Rooms
RoomSchedule
Selections
AnalyticalSupportData_Info
AreaReinCurve
AreaReinParameters
BoundaryConditions
ContextualAnalyticalModel
CreateBeamsColumnsBraces
CreateBeamSystem
CreateComplexAreaRein
CreateSimpleAreaRein
CreateWallinBeamProfile
CreateWallsUnderBeams
CurvedBeam
FrameBuilder
GenericStructuralConnection
Loads
MultiplanarRebar
NewPathReinforcement
NewRebar
PathReinforcement
RebarContainerAnyShapeType
RebarFreeForm
Reinforcement
RotateFramingObjects
SampleCommandsSteelElements
StructSample
StructuralLayerFunction
Truss
ContextualAnalyticalModel
DockableDialogs
SheetToView3D
AllViews
CreateViewSection
Custom2DExporter
DisplacementElementAnimation
DuplicateViews
ObjectViewer
PathOfTravel
ScheduleAutomaticFormatter
ScheduleCreation
ScheduleToHTML
ViewTemplateCreation
VisibilityControl
DirectionCalculation
DistanceToSurfaces
DynamicModelUpdate
ExtensibleStorageManager
FindColumns
MaterialQuantities
MultithreadedCalculation
ObjectViewer
ParameterValuesFromImage
PointCloudEngine
PostCommandWorkflow
RebarFreeForm
SheetToView3D
SpatialFieldGradient
WinderStairs
APIAppStartup
AreaReinCurve
AutoRoute
BrowseBindings
CancelSave
CapitalizeAllTextNotes
ComputedSymbolGeometry
CreateFillPattern
CreateShared
CreateTrianglesTopography
CurvedBeam
DatumsModification
DeckProperties
DeleteDimensions
DeleteObject
DesignOptionReader
DimensionLeaderEnd
DisableCommand
DistanceToPanels
DWGFamilyCreation
FireRating
GenericStructuralConnection
HelloRevit
InCanvasControlAPI
LevelsProperty
MeasurePanelArea
ModelLines
MoveLinear
PanelEdgeLengthAngle
PanelSchedule
ParameterUtils
PerformanceAdviserControl
PhaseSample
PhysicalProp
PointCurveCreation
PowerCircuit
ProjectInfo
RevitCommands
Ribbon
Rooms
RvtSamples
ScheduleCreation
SelectionChanged
Selections
SlabProperties
SolidSolidCut
SpanDirection
SpotDimension
StructSample
StructuralLayerFunction
TagBeam
TestFloorThickness
TestWallThickness
TypeRegeneration
TypeSelector
Units
ValidateParameters
VersionChecking
WindowWizard
BoundaryConditions
CloudAPISample
CreateBeamSystem
DisplacementElementAnimation
DuplicateGraphics
GridCreation
ImportExport
MultiplanarRebar
NewHostedSweep
NewOpenings
NewRebar
NewRoof
Openings
RebarContainerAnyShapeType
Reinforcement
RoomSchedule
SampleCommandsSteelElements
ScheduleAutomaticFormatter
ShaftHolePuncher
AddSpaceAndZone
AllViews
AnalyticalSupportData_Info
AnalyticalViewer
AppearanceAssetEditing
ArchSample
AreaReinParameters
AttachedDetailGroup
AutoJoin
AutoParameter
AutoStamp
AutoTagRooms
AutoUpdate
AvoidObstruction
BeamAndSlabNewParameter
BRepBuilderExample
ChangesMonitor
CivilAlignments
ColorFill
CompoundStructure
ContextualAnalyticalModel
CreateAirHandler
CreateBeamsColumnsBraces
CreateComplexAreaRein
CreateDimensions
CreateSimpleAreaRein
CreateTruss
CreateViewSection
CreateWallinBeamProfile
CreateWallsUnderBeams
CurtainSystem
CurtainWallGrid
Custom2DExporter
DividedSurfaceByIntersects
DockableDialogs
DoorSwing
DuplicateViews
ElementViewer
EnergyAnalysisModel
ErrorHandling
EventsMonitor
ExportPDFSettingsSample
ExtensibleStorageUtility
ExternalResourceDBServer
ExternalResourceUIServer
FabricationPartLayout
FamilyParametersOrder
FoundationSlab
FrameBuilder
FreeFormElement
GenerateFloor
GenericModelCreation
GeometryCreation_BooleanOperation
GetSetDefaultTypes
InPlaceMembers
InvisibleParam
Journaling
Loads
ManipulateForm
MaterialProperties
MeasureHeight
ModelessForm_ExternalEvent
ModelessForm_IdlingEvent
MultistoryStairs
NewForm
NewPathReinforcement
PathOfTravel
PathReinforcement
PlaceFamilyInstanceByFace
PlacementOptions
PrintLog
ProgressNotifier
ProximityDetection_WallJoinControl
RayTraceBounce
ReadonlySharedParameters
ReferencePlane
RevitViewer
RoofsRooms
RoomViewer
RotateFramingObjects
RoutingPreferenceTools
ScheduleToHTML
SharedCoordinateSystem
SinePlotter
Site
SlabShapeEditing
StairsAutomation
TransactionControl
TraverseSystem
Truss
UIAPI
UpdateExternallyTaggedBRep
ViewFilters
ViewPrinter
ViewTemplateCreation
VisibilityControl
WorkThread
AnalyticalViewer
APIAppStartup
ArchSample
AutoTagRooms
BrowseBindings
CreateShared
CurvedBeam
DuplicateGraphics
ElementViewer
FireRating
ImportExport
MoveLinear
MultistoryStairs
NewOpenings
NewPathReinforcement
PathReinforcement
PhysicalProp
ProjectInfo
RebarFreeForm
RevitCommands
RevitViewer
RoomViewer
ShaftHolePuncher
SpotDimension
StructSample
TagBeam
TestFloorThickness
TestWallThickness
TransactionControl
TypeSelector
ViewPrinter
VisibilityControl
AppearanceAssetEditing
DeckProperties
HelloRevit
InvisibleParam
ParameterUtils
SpanDirection
AddSpaceAndZone
AllViews
AnalyticalSupportData_Info
AreaReinCurve
AreaReinParameters
BeamAndSlabNewParameter
CreateBeamsColumnsBraces
CreateComplexAreaRein
CreateDimensions
CreateSimpleAreaRein
CreateViewSection
CreateWallinBeamProfile
CreateWallsUnderBeams
CurtainSystem
CurtainWallGrid
Custom2DExporter
DeleteDimensions
DeleteObject
DesignOptionReader
DoorSwing
GenerateFloor
GridCreation
InPlaceMembers
LevelsProperty
Loads
MaterialProperties
NewHostedSweep
NewRebar
NewRoof
ObjectViewer
PhaseSample
PlaceFamilyInstanceByFace
PowerCircuit
RotateFramingObjects
RvtSamples
SampleCommandsSteelElements
SlabProperties
SlabShapeEditing
StructuralLayerFunction
Truss
VersionChecking
AttachedDetailGroup
BoundaryConditions
CreateBeamSystem
FoundationSlab
FrameBuilder
Journaling
Openings
ReferencePlane
Reinforcement
RoofsRooms
Rooms
SharedCoordinateSystem
APIAppStartup
AutoTagRooms
CurvedBeam
ImportExport
NewOpenings
NewPathReinforcement
PathReinforcement
ProjectInfo
ShaftHolePuncher
SpotDimension
TagBeam
TestFloorThickness
TestWallThickness
TransactionControl
ViewPrinter
VisibilityControl
ModelLines
RoomSchedule
AddSpaceAndZone
CurtainSystem
CurtainWallGrid
DoorSwing
GridCreation
NewHostedSweep
NewRebar
NewRoof
PlaceFamilyInstanceByFace
PowerCircuit
RvtSamples
SlabShapeEditing
Truss
RoofsRooms
AutoJoin
AutoParameter
AutoRoute
AutoStamp
AutoUpdate
AvoidObstruction
CancelSave
CreateAirHandler
CreateTruss
DistanceToPanels
DWGFamilyCreation
EventsMonitor
GenericModelCreation
ManipulateForm
MeasurePanelArea
NewForm
PanelEdgeLengthAngle
PrintLog
RayTraceBounce
Ribbon
TraverseSystem
TypeRegeneration
ValidateParameters
WindowWizard
ChangesMonitor
DirectionCalculation
DistanceToSurfaces
DividedSurfaceByIntersects
DynamicModelUpdate
ErrorHandling
FindColumns
MaterialQuantities
MeasureHeight
PanelSchedule
ParameterValuesFromImage
PointCurveCreation
ProximityDetection_WallJoinControl
Selections
SolidSolidCut
SpatialFieldGradient
ViewFilters
CompoundStructure
ComputedSymbolGeometry
CreateFillPattern
EnergyAnalysisModel
ExtensibleStorageManager
GeometryCreation_BooleanOperation
MultiplanarRebar
MultithreadedCalculation
PerformanceAdviserControl
PointCloudEngine
DisableCommand
ModelessForm_ExternalEvent
ModelessForm_IdlingEvent
ProgressNotifier
RoutingPreferenceTools
ScheduleCreation
SinePlotter
StairsAutomation
UIAPI
WinderStairs
WorkThread
DisplacementElementAnimation
DockableDialogs
DuplicateViews
ExtensibleStorageUtility
FreeFormElement
PostCommandWorkflow
ScheduleAutomaticFormatter
ScheduleToHTML
Site
Units
DatumsModification
DimensionLeaderEnd
ExternalResourceDBServer
ExternalResourceUIServer
FamilyParametersOrder
GetSetDefaultTypes
ReadonlySharedParameters
FabricationPartLayout
RebarContainerAnyShapeType
BRepBuilderExample
CapitalizeAllTextNotes
GenericStructuralConnection
PlacementOptions
DuplicateGraphics
MultistoryStairs
RebarFreeForm
AppearanceAssetEditing
Custom2DExporter
SampleCommandsSteelElements
AttachedDetailGroup
CreateTrianglesTopography
CloudAPISample
ExportPDFSettingsSample
InCanvasControlAPI
PathOfTravel
ViewTemplateCreation
CivilAlignments
ColorFill
UpdateExternallyTaggedBRep
ContextualAnalyticalModel
SelectionChanged
SheetToView3D
This section lists the sample applications in alphabetical order and briefly discusses what each application does.
A |
B |
C |
D |
E |
F |
G |
H |
I |
J | K |
L |
M |
N |
O |
P | Q |
R |
S |
T | U |
V |
W | X | Y | Z