ItemFactoryBaseNewDimension(View, Line, ReferenceArray) Method |
Creates a new linear dimension object using the default dimension style.
Namespace: Autodesk.Revit.CreationAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic Dimension NewDimension(
View view,
Line line,
ReferenceArray references
)
Public Function NewDimension (
view As View,
line As Line,
references As ReferenceArray
) As Dimension
public:
Dimension^ NewDimension(
View^ view,
Line^ line,
ReferenceArray^ references
)
member NewDimension :
view : View *
line : Line *
references : ReferenceArray -> Dimension
Parameters
- view View
- The view in which the dimension is to be visible.
The view must be if the document is in [!:Autodesk::Revit::DB::SketchEditScope].
- 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
Dimension If successful a new dimension object, otherwise
.
ExceptionsException | Condition |
---|
ArgumentException | Thrown when references are not geometric references. |
Remarks The currently user set default style is used for the created dimension.
ExampleDimension CreateNewDimensionAlongLine(Autodesk.Revit.DB.Document document, Line line)
{
ReferenceArray references = new ReferenceArray();
references.Append(line.GetEndPointReference(0));
references.Append(line.GetEndPointReference(1));
Dimension dimension = document.Create.NewDimension(document.ActiveView,
line, references);
return dimension;
}
Private Function CreateNewDimensionAlongLine(document As Autodesk.Revit.DB.Document, line As Line) As Dimension
Dim references As New ReferenceArray()
references.Append(line.GetEndPointReference(0))
references.Append(line.GetEndPointReference(1))
Dim dimension As Dimension = document.Create.NewDimension(document.ActiveView, line, references)
Return dimension
End Function
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also