GetIndentLevel Method


Formatted Text Get Indent Level Method

Returns the indent level of the paragraphs in the text range.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public int GetIndentLevel(
	TextRange textRange
)

Parameters

textRange TextRange
The given text range.

Return Value

Int32
The indentation level of the paragraphs in the range.
Exceptions
Exception Condition
ArgumentException This start index of this text range is not within the text range identifying the entire text. -or- The end of this text range is not within the text range identifying the entire text.
ArgumentNullException A non-optional argument was null
Remarks
Returns -1 if the range contains multiple paragraphs with different indent levels.
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 →