NewDimension Method (View, Line, ReferenceArray, DimensionType)


Creates a new linear dimension object using the specified dimension style.

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

Syntax

C#
public Dimension NewDimension(
	View view,
	Line line,
	ReferenceArray references,
	DimensionType dimensionType
)
Visual Basic
Public Function NewDimension ( _
	view As View, _
	line As Line, _
	references As ReferenceArray, _
	dimensionType As DimensionType _
) As Dimension
Visual C++
public:
Dimension^ NewDimension(
	View^ view, 
	Line^ line, 
	ReferenceArray^ references, 
	DimensionType^ dimensionType
)

Parameters

view
Type: Autodesk.Revit.DBView
The view in which the dimension is to be visible. The view must be a null reference (Nothing in Visual Basic) if the document is in [!:Autodesk::Revit::DB::SketchEditScope].
line
Type: Autodesk.Revit.DBLine
The line drawn for the dimension.
references
Type: Autodesk.Revit.DBReferenceArray
An array of geometric references to which the dimension is to be bound.
dimensionType
Type: Autodesk.Revit.DBDimensionType
The dimension style to be used for the dimension.

Return Value

If successful a new dimension object, otherwise a null reference (Nothing in Visual Basic).

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentExceptionThrown when references are not geometric references.

See Also