2024 Method
Changes 0
M

Grid.Create

Description:
Creates a new grid line.
Remarks:
The line should be on a horizontal plane.
Overloads (2):
Create(Document,Line)
public static Grid Create(
	Document document,
	Line line
)
Return Value Grid The newly created grid line.
// Create the geometry line which the grid locates
 XYZ start = new XYZ(0, 0, 0);
 XYZ end = new XYZ(30, 30, 0);
 Line geomLine = Line.CreateBound(start, end);

 // Create a grid using the geometry line
 Grid lineGrid = Grid.Create(document, geomLine);

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

 // Modify the name of the created grid
 lineGrid.Name = "New Name1";