Create Method (Document, Arc)
Creates a new radial grid line.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)

Syntax

C#
public static Grid Create(
	Document document,
	Arc arc
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	arc As Arc _
) As Grid
Visual C++
public:
static Grid^ Create(
	Document^ document, 
	Arc^ arc
)

Parameters

document
Type: Autodesk.Revit.DB..::..Document
The document in which the new instance is created.
arc
Type: Autodesk.Revit.DB..::..Arc
An arc object that represents the location of the new grid line.

Return Value

The newly created grid line.

Remarks

The arc should be on a horizontal plane.

Examples

CopyC#
// Create the geometry arc which the grid locates
XYZ end0 = new XYZ(0, 0, 0);
XYZ end1 = new XYZ(10, 40, 0);
XYZ pointOnCurve = new XYZ(5, 7, 0);
Arc geomArc = Arc.Create(end0, end1, pointOnCurve);


// Create a grid using the geometry arc
Grid arcGrid = Grid.Create(document, geomArc);

if (null == arcGrid)
{
    throw new Exception("Create a new curved grid failed.");
}

// Modify the name of the created grid
arcGrid.Name = "New Name2";
CopyVB.NET
   ' Create the geometry arc which the grid locates
   Dim end0 As New XYZ(0, 0, 0)
   Dim end1 As New XYZ(10, 40, 0)
   Dim pointOnCurve As New XYZ(5, 7, 0)
   Dim geomArc As Arc = Arc.Create(end0, end1, pointOnCurve)


   ' Create a grid using the geometry arc
Dim arcGrid As Grid = Grid.Create(document, geomArc)

   If arcGrid Is Nothing Then
       Throw New Exception("Create a new curved grid failed.")
   End If

   ' Modify the name of the created grid
   arcGrid.Name = "New Name2"

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentException document is not a project document. -or- The input arc is not on horizontal plane.
Autodesk.Revit.Exceptions..::..ArgumentNullException A non-optional argument was null

See Also