GetScheduleInstances Method


Gets the instances ids of schedule or schedule segment.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Since: 2022.1

Syntax

C#
public IList<ElementId> GetScheduleInstances(
	int segmentIndex
)
Visual Basic
Public Function GetScheduleInstances ( _
	segmentIndex As Integer _
) As IList(Of ElementId)
Visual C++
public:
IList<ElementId^>^ GetScheduleInstances(
	int segmentIndex
)

Parameters

segmentIndex
Type: System Int32
Index of the segment.

Return Value

The array of schedule sheet instance element ids of schedule or schedule segment.

Remarks

The segment index value could be -1, it means to get schedule instances for the entire schedule.

When a (primary) schedule is set to filter by sheet and placed on a sheet, it will create a new schedule with elements visible in the Viewport(s) on that sheet. The instance created belongs to the newly created schedule. Calls to GetScheduleInstances() will return instances of the newly created schedule but no instances of the primary schedule.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The segment index should start from -1 and be less than the total segment count.

See Also