Create Method


Creates a new Viewport at a given location on a sheet.

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

Syntax

C#
public static Viewport Create(
	Document document,
	ElementId viewSheetId,
	ElementId viewId,
	XYZ point
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	viewSheetId As ElementId, _
	viewId As ElementId, _
	point As XYZ _
) As Viewport
Visual C++
public:
static Viewport^ Create(
	Document^ document, 
	ElementId^ viewSheetId, 
	ElementId^ viewId, 
	XYZ^ point
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document to which the new Viewport will be added.
viewSheetId
Type: Autodesk.Revit.DBElementId
The ViewSheet on which the new Viewport will be placed.
viewId
Type: Autodesk.Revit.DBElementId
The view shown in the Viewport.
point
Type: Autodesk.Revit.DBXYZ
The new Viewport will be centered on this point.

Return Value

The new Viewport.

Remarks

Use [!:Autodesk::Revit::DB::ScheduleSheetInstance::Create()] to add schedules to sheets.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException viewSheetId is not a ViewSheet. -or- viewId cannot be added to the ViewSheet. -or- Plan view creation is not allowed in this family.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsForbiddenForDynamicUpdateException This method may not be called during dynamic update.
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 →