SetDrivingDimension Method


Global Parameter Set Driving Dimension Method

Set a dimension to drive the value of this parameter.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public void SetDrivingDimension(
	ElementId dimensionId
)

Parameters

dimensionId ElementId
Id of a dimension element.
Exceptions
Exception Condition
ArgumentException Given element Id is not of a valid dimension element. -or- Dimension with the Id of dimensionId cannot be labeled by this global parameter. Possible causes include the dimension cannot be labeled at all, or it is a dimension of other than Linear or Angular type, or the Dimension object does not have the appropriate labeling parameter, or the dimension has more than one segment and the parameter is reporting.
ArgumentNullException A non-optional argument was null
InvalidOperationException This is a formula-driven parameter. As such it does not allow the current operation. -or- This non-reporting global parameter has already labeled other dimension segments (more then 1). It cannot, therefore, be made reporting and dimension-driven before un-labeling all the dependent dimensions first.
Remarks

This method is a combined action of two steps: a) Making the parameter reporting if it is not yet, and b) Labeling the given dimension with it. Because of that, the parameter must be eligible for reporting - i.e must be of certain types, and must not be used to label more than one dimensions yet.

In case this parameter is already driven by another dimension, the other dimension will be unlabeled first before the given one is labeled. It is because a reporting parameter can only label one dimension at a time (i.e. it can be driven by one dimension only.)

See Also