GridCreate(Document, Line) Method |
Creates a new grid line.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic static Grid Create(
Document document,
Line line
)
Public Shared Function Create (
document As Document,
line As Line
) As Grid
public:
static Grid^ Create(
Document^ document,
Line^ line
)
static member Create :
document : Document *
line : Line -> Grid
Parameters
- document Document
-
The document in which the new instance is created.
- line Line
-
A line which represents the location of the grid line.
Return Value
Grid
The newly created grid line.
Exceptions
Remarks
The line should be on a horizontal plane.
Example
XYZ start = new XYZ(0, 0, 0);
XYZ end = new XYZ(30, 30, 0);
Line geomLine = Line.CreateBound(start, end);
Grid lineGrid = Grid.Create(document, geomLine);
if (null == lineGrid)
{
throw new Exception("Create a new straight grid failed.");
}
lineGrid.Name = "New Name1";
Dim start As New XYZ(0, 0, 0)
Dim [end] As New XYZ(30, 30, 0)
Dim geomLine As Line = Line.CreateBound(start, [end])
Dim lineGrid As Grid = Grid.Create(document, geomLine)
If lineGrid Is Nothing Then
Throw New Exception("Create a new straight grid failed.")
End If
lineGrid.Name = "New Name1"
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