View
|
Creates a new view position element.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)

public static ViewPosition Create(
Document document,
string name,
XYZ position,
ViewAnchor viewAnchor
)
Parameters
- document Document
- The document to which the ViewPosition will be added.
- name String
- The name of the view position element.
- position XYZ
- The position of the view.
- viewAnchor ViewAnchor
- The method the view will be positioned on the sheet.
Return Value
ViewPositionThe newly created view position element.

Exception | Condition |
---|---|
ArgumentException | document is not a project document. -or- name is an empty string or contains only whitespace. -or- name cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~". -or- The given value for name is already in use as a view position name. |
ArgumentNullException | A non-optional argument was null |
ArgumentOutOfRangeException | A value passed for an enumeration argument is not a member of that enumeration |
