NewControl Method


Add a new control into the Autodesk Revit family document.

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

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.DBControlShape
The shape of the control.
view
Type: Autodesk.Revit.DBView
The view in which the control is to be visible. It must be a FloorPlan view or a CeilingPlan view.
origin
Type: Autodesk.Revit.DBXYZ
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.ExceptionsArgumentNullException Thrown when the input argument-"view" or "position"-is a null reference (Nothing in Visual Basic).
Autodesk.Revit.ExceptionsArgumentException Thrown when the input argument-"view"-is invalid.
Autodesk.Revit.ExceptionsArgumentOutOfRangeException Thrown when the input argument-"controlType"-is out of range.
Autodesk.Revit.ExceptionsInvalidOperationException Thrown when control creation failed.

See Also