Application: SpatialFieldGradient
Revit Platform: All
Revit Version: 2011.0
First Released For: 2011.0
Programming Language: C#
Skill Level: Advanced
Category: Geometry
Type: ExternalCommand

Subject: Display analysis results in a Revit model

Summary: Select a face and display numeric data on that face

Classes: 
Autodesk.Revit.DB.Analysis.AnalysisDisplayColoredSurfaceSettings
Autodesk.Revit.DB.Analysis.AnalysisDisplayColorSettings
Autodesk.Revit.DB.Analysis.AnalysisDisplayLegendSettings
Autodesk.Revit.DB.Analysis.AnalysisDisplayStyle
Autodesk.Revit.DB.Analysis.FieldDomainPointsByUV
Autodesk.Revit.DB.Analysis.FieldValues
Autodesk.Revit.DB.Analysis.SpatialFieldManager
Autodesk.Revit.DB.FilteredElementCollector
Autodesk.Revit.DB.TextNoteType
Autodesk.Revit.DB.BoundingBoxUV
Autodesk.Revit.UI.Selection.Selection

Project Files:
Command.cs

Description: 
1.	Create an AnalysisDisplayColoredSurfaceSettings object and set it to show gridlines on the surfaces
2.	Create an AnalysisDisplayColorSettings object and set min and max colors
3.	Create an AnalysisDisplayLegendSettings object and specify various legend settings
4.	Create an Analysis Display Style using the settings created in the previous steps
5.	Set the active view to use this Analysis Display Style
6.	Create a list (measureNames) so that each data point can store multiple values
7.	Create lists (unitNames & multipliers) so that the data can be displayed in both feet and inches
8.	When a face is selected
a.	Divide the face’s U & V parameterization into 10 segments in each direction
b.	Create three values based on the face’s U value at each point (U, U + 1, U * 10)
9.	Update the spatial field primitive to show this data on the face.

Instructions: 
1.	Run the external command
2.	Select a face