Add a new control into the Autodesk Revit family document.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)

Syntax

C#
public Control NewControl(
	ControlShape controlShape,
	View view,
	XYZ origin
)
Visual Basic
Public Function NewControl ( _
	controlShape As ControlShape, _
	view As View, _
	origin As XYZ _
) As Control
Visual C++
public:
Control^ NewControl(
	ControlShape controlShape, 
	View^ view, 
	XYZ^ origin
)

Parameters

controlShape
Type: Autodesk.Revit.DB..::..ControlShape
The shape of the control.
view
Type: Autodesk.Revit.DB..::..View
The view in which the control is to be visible. It must be a FloorPlan view or a CeilingPlan view.
origin
Type: Autodesk.Revit.DB..::..XYZ
The origin of the control.

Return Value

If successful, the newly created control is returned, otherwise an exception with error information will be thrown.

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentNullException Thrown when the input argument-"view" or "position"-is nullNothingnullptra null reference (Nothing in Visual Basic).
Autodesk.Revit.Exceptions..::..ArgumentException Thrown when the input argument-"view"-is invalid.
Autodesk.Revit.Exceptions..::..ArgumentOutOfRangeException Thrown when the input argument-"controlType"-is out of range.
Autodesk.Revit.Exceptions..::..InvalidOperationException Thrown when control creation failed.

See Also