LabelDimension Method


Global Parameter Label Dimension Method

Labels a dimension with this global parameter.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public void LabelDimension(
	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
Remarks

When a dimension is labeled by a global parameters, then its value is either controlled by the parameter (non-reporting), or drives the value of the parameter (reporting). It is important to note that a reporting parameter can label at most one dimension object - meaning, a parameter can be driven by one dimension only. If the dimension has several segments and is labeled by a non-reprting parameter, the value of each segment will be driven by this parameter. Multi-segmented dimensions cannot be labeled by reporting parameters.

If the dimension is already labeled by another global parameter, labeling it again will automatically detach it from that parameter.

Presently, not just any kind of dimensions may be labeled by a global parameter. Typically only single Linear and Angular dimensions can be labeled, but there are other restrictions in effect too. Also, for the value of the parameter and dimension labeled by it depend on each other, the data type of the global parameters must be either Length or Angle , since those are the only units a dimension can represent. Refer to the [!:CanLabelDimension(Autodesk::Revit::DB::ElementId)] method to find out whether a particular dimension element may be labeled or not.

See Also