SetColorFillSchemeId Method


Applies color fill scheme to this view.

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

Syntax

C#
public void SetColorFillSchemeId(
	ElementId categoryId,
	ElementId schemeId
)
Visual Basic
Public Sub SetColorFillSchemeId ( _
	categoryId As ElementId, _
	schemeId As ElementId _
)
Visual C++
public:
void SetColorFillSchemeId(
	ElementId^ categoryId, 
	ElementId^ schemeId
)

Parameters

categoryId
Type: Autodesk.Revit.DBElementId
The id of category to apply a color fill scheme element.
schemeId
Type: Autodesk.Revit.DBElementId
The id of the color fill scheme element.

Remarks

There could be at most three [!:Autodesk::Revit::DB::ColorFillScheme] applied in a view: one for spatial elements (rooms, zones, spaces and areas), one for pipes and one for ducts.

Notes:

  • There's at most one scheme activated for all spatial categories.
  • For area plan view, the activated spatial scheme category must be OST_Areas and has the same [!:Autodesk::Revit::DB::AreaScheme] with this view if it is not used as a template.
  • To clear one of the above three schemes, use InvalidElementId as the parameter of this function.
  • To get list of element categories supportted to be colored in this view, use SupportedColorFillCategoryIds.
  • To check whether an specified ElementId could be applied to this view, use CanApplyColorFillScheme(ElementId, ElementId).

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The schemeId can not be applied as the scheme id of categoryId in this view.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

See Also