RVTDocs.com

ItemFactoryBase.NewDimension(View, Line, ReferenceArray)

Method
Description:
Creates a new linear dimension object using the default dimension style.
Remarks:
The currently user set default style is used for the created dimension.
Syntax
public Dimension NewDimension(
	View view,
	Line line,
	ReferenceArray references
)
Examples
Dimension CreateNewDimensionAlongLine(Autodesk.Revit.DB.Document document, Line line)
{
    // Use the Start and End points of our line as the references  
    // Line must come from something in Revit, such as a beam
    ReferenceArray references = new ReferenceArray();
    references.Append(line.GetEndPointReference(0));
    references.Append(line.GetEndPointReference(1));

    // create the new dimension
    Dimension dimension = document.Create.NewDimension(document.ActiveView,
                                                        line, references);
    return dimension;
}
Parameters
Parameter Type Description
view View The view in which the dimension is to be visible. The view must be <span class="keyword"><span data-languagespecifictext="cpp=nullptr|vb=Nothing|nu=null" id="LST6B823545_1"></span></span> if the document is in <span class="noLink">[!:Autodesk::Revit::DB::SketchEditScope]</span>.
line Line The line drawn for the dimension.
references ReferenceArray An array of geometric references to which the dimension is to be bound.
Return Value
Type Description
Dimension If successful a new dimension object, otherwise .
Exceptions
Exception Condition
ArgumentException Thrown when references are not geometric references.