Creates a new model line element.
Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.0.0.0)
Syntax
Return Value
If successful a new model line element. Otherwise
nullNothingnullptra null reference (Nothing in Visual Basic).
Remarks
Examples
CopyC#
Autodesk.Revit.ApplicationServices.Application application = document.Application;
XYZ startPoint = new XYZ(0, 0, 0);
XYZ endPoint = new XYZ(10, 10, 0);
Line geomLine = Line.CreateBound(startPoint, endPoint);
XYZ end0 = new XYZ(1, 0, 0);
XYZ end1 = new XYZ(10, 10, 10);
XYZ pointOnCurve = new XYZ(10, 0, 0);
Arc geomArc = Arc.Create(end0, end1, pointOnCurve);
XYZ origin = new XYZ(0, 0, 0);
XYZ normal = new XYZ(1, 1, 0);
Plane geomPlane = Plane.CreateByNormalAndOrigin(normal, origin);
SketchPlane sketch = SketchPlane.Create(document, geomPlane);
ModelLine line = document.Create.NewModelCurve(geomLine, sketch) as ModelLine;
ModelArc arc = document.Create.NewModelCurve(geomArc, sketch) as ModelArc;
CopyVB.NET
Dim application As Autodesk.Revit.ApplicationServices.Application = document.Application
Dim startPoint As New XYZ(0, 0, 0)
Dim endPoint As New XYZ(10, 10, 0)
Dim geomLine As Line = Line.CreateBound(startPoint, endPoint)
Dim end0 As New XYZ(1, 0, 0)
Dim end1 As New XYZ(10, 10, 10)
Dim pointOnCurve As New XYZ(10, 0, 0)
Dim geomArc As Arc = Arc.Create(end0, end1, pointOnCurve)
Dim origin As New XYZ(0, 0, 0)
Dim normal As New XYZ(1, 1, 0)
Dim geomPlane As Plane = Plane.CreateByNormalAndOrigin(normal, origin)
Dim sketch As SketchPlane = SketchPlane.Create(document, geomPlane)
Dim line__1 As ModelLine = TryCast(document.Create.NewModelCurve(geomLine, sketch), ModelLine)
Dim arc__2 As ModelArc = TryCast(document.Create.NewModelCurve(geomArc, sketch), ModelArc)
Exceptions
See Also