ColorFillScheme Class


Represents a color scheme could be used to colorfy elements in floor plan views and section views.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2022

Syntax

C#
public class ColorFillScheme : Element
Visual Basic
Public Class ColorFillScheme _
	Inherits Element
Visual C++
public ref class ColorFillScheme : public Element

Remarks

A color scheme is based on element category and one of the category parameter, it contains a set of ColorFillSchemeEntry which stores parameter value, color, fill pattern and other entry data. The entry paramater values may be a range or a single value, based on the IsByRange property. Then elements with the specified category could be colored with the color and fill pattern of matching entry whose parameter value or value range matches the element parameter value.

You can retrieve the entries with GetEntries , or modify entries with AddEntry(ColorFillSchemeEntry) , RemoveEntry(ColorFillSchemeEntry) , UpdateEntry(ColorFillSchemeEntry) and [M:Autodesk.Revit.DB.ColorFillScheme.SetEntries(System.Collections.Generic.IList`1{Autodesk.Revit.DB.ColorFillSchemeEntry})] .

Unlike most of the other elements, the color scheme works in an "asynchronous" way in UI:

  1. If document elements change, the color scheme will not be updated immediately.
  2. If color schemes changes, the document elements will not be updated immediately too.

API works slightly different with UI:

  1. GetEntries will return the entries corresponding to the latest document elements status immediately.
  2. The entries modification operation will retrieve the latest entries with GetEntries at first, and then modify those entries by request, but document elements will still not be updated immediately.
  3. To modify multiple entries, it's better to use [M:Autodesk.Revit.DB.ColorFillScheme.SetEntries(System.Collections.Generic.IList`1{Autodesk.Revit.DB.ColorFillSchemeEntry})] but not modify them one by one with other methods for better performance.

Notes:

  • To apply a color scheme whose CategoryId property is OST_Areas to an area plan view, the AreaSchemeId property must be the same as the view if it is not used as a template.
  • To generate a new color scheme, you have to use Duplicate(String) method to duplicate form an existing one.
  • There should not exist two entries values that are the same in a color scheme. if the StorageType property is Double, then the value accuracy should be based on FormatOptions property.

Inheritance Hierarchy

System Object
Autodesk.Revit.DB Element
Autodesk.Revit.DB ColorFillScheme

See Also