PromptToPlaceViewOnSheet Method


Prompts the user to place a specified view onto a sheet.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2015

Syntax

C#
public void PromptToPlaceViewOnSheet(
	View view,
	bool allowReplaceExistingSheetViewport
)
Visual Basic
Public Sub PromptToPlaceViewOnSheet ( _
	view As View, _
	allowReplaceExistingSheetViewport As Boolean _
)
Visual C++
public:
void PromptToPlaceViewOnSheet(
	View^ view, 
	bool allowReplaceExistingSheetViewport
)

Parameters

view
Type: Autodesk.Revit.DB View
The view to insert onto a sheet.
allowReplaceExistingSheetViewport
Type: System Boolean
A indicator which allows the user to replace the existing viewport.

If true, the viewport representing this view will be replaced by the new viewport created during placement. If the view is allowed only to be on one sheet, this will remove the viewport from the old sheet. If the view is allowed to be on multiple sheets, and the view is currently placed on the active sheet, the old viewport on this sheet will be replaced.

If false, if the view is only allowed to be on one sheet, or if the view is allowed to be on multiple sheets but is already on the active sheet, an exception will be thrown.

Remarks

This method opens its own transaction, so it's not permitted to be invoked in an active transaction. In a single invocation, the user can place only one view onto the active sheet. The user is not permitted to change the active sheet view or the view to be placed during this placement operation (the operation will be cancelled). The user can cancel the placement operation by pressing Cancel or ESC or a click elsewhere in the UI.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException This view is a view template.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException This document is not the currently active one. -or- Starting a new transaction is not permitted. It could be because another transaction already started and has not been completed yet, or the document is in a state in which it cannot start a new transaction. -or- The active view isn't a sheet where a view can be placed. -or- Thrown when replacing an existing viewport isn't allowed. See allowReplaceExistingSheetViewport parameter documentation for details.

See Also