ViewPositionCreate Method |
Creates a new view position element.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic static ViewPosition Create(
Document document,
string name,
XYZ position,
ViewAnchor viewAnchor
)
Public Shared Function Create (
document As Document,
name As String,
position As XYZ,
viewAnchor As ViewAnchor
) As ViewPosition
public:
static ViewPosition^ Create(
Document^ document,
String^ name,
XYZ^ position,
ViewAnchor viewAnchor
)
static member Create :
document : Document *
name : string *
position : XYZ *
viewAnchor : ViewAnchor -> ViewPosition
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
ViewPosition
The newly created view position element.
ExceptionsException | 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
|
See Also