GetColorOverrideForCategory Method


Coordination Model Link Utils Get Color Override For Category Method

Returns the color override value for the provided element category name inside the provided Coordination Model type.

Namespace: Autodesk.Revit.DB.ExternalData
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public static Color GetColorOverrideForCategory(
	Document document,
	View view,
	ElementType coordinationModelType,
	string categoryName
)

Parameters

document Document
The document.
view View
The view.
coordinationModelType ElementType
The Coordination Model type element where the provided element category name is found.
categoryName String
The name of the element category inside the provided Coordination Model type.

Return Value

Color
Returns the color override value for the provided element category name inside the provided Coordination Model type. InvalidColorValue means no override is set.
Exceptions
Exception Condition
ArgumentException document is not a project document. -or- The element coordinationModelType was not found in the given document. -or- The name categoryName is not a category name in the provided AutodeskDocs Coordination Model type.
ArgumentNullException A non-optional argument was null
InvalidOperationException The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).
Remarks

By default, the color setting has no override and its value is InvalidColorValue.

See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →