After Revit 2018, the method for obtaining Grid Reference has been modified. You need to use the following code to retrieve it:

1
2
3
4
5
foreach (Grid grid in grids)
{
var reference = new Reference(grid);
gridReferences.Append(reference);
}

Previously, you needed to get the Grid’s Curve.Reference to create dimensions:

1
gridReferences.Append(grid.Curve.Reference);

The change should be made to obtain Grid References more safely and conveniently. For details on the official response regarding this matter, please refer to the article below:
Invalid Number of References

![Image Description](https://cdn.bimath.com/blog/pg/Snipaste_2026-01-04_16-20-48.png)