Create Method (Document, ElementId, ElementId, XYZ, Int32)


Creates an instance of a schedule segment on a sheet.

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

Syntax

C#
public static ScheduleSheetInstance Create(
	Document document,
	ElementId viewSheetId,
	ElementId scheduleId,
	XYZ origin,
	int segmentIndex
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	viewSheetId As ElementId, _
	scheduleId As ElementId, _
	origin As XYZ, _
	segmentIndex As Integer _
) As ScheduleSheetInstance
Visual C++
public:
static ScheduleSheetInstance^ Create(
	Document^ document, 
	ElementId^ viewSheetId, 
	ElementId^ scheduleId, 
	XYZ^ origin, 
	int segmentIndex
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document
viewSheetId
Type: Autodesk.Revit.DBElementId
The id of the sheet where the schedule segment will be placed.
scheduleId
Type: Autodesk.Revit.DBElementId
The id of the schedule view.
origin
Type: Autodesk.Revit.DBXYZ
Location on the sheet where the schedule segment will be placed.
segmentIndex
Type: SystemInt32
The schedule segment index of the schedule instance.

Return Value

The new ScheduleInstance.

Remarks

The segment index value could be -1, which means to create an instance for the entire schedule, see SegmentIndex property for more details.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException scheduleId is not a ViewSchedule that can be added to sheets. "Internal" schedules are not user-visible but are filtered by sheet or used to manage Revisions, which cannot be added to sheets. -or- viewSheetId is not a ViewSheet. -or- segmentIndex is not a valid segment index.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsModificationForbiddenException 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). -or- The document is being loaded, or is in the midst of another sensitive process.
Autodesk.Revit.ExceptionsModificationOutsideTransactionException The document has no open transaction.

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 →