Fail to get reference for grid for dimension in 2017

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We want to create dimensions between grids.
In version 2015 and before, we can get grid reference from Grid.Curve.Reference and it's OK to create dimensions.
In version 2016, previous reference doesn't work, in this forum, we get the idea that use following code to get the grid reference:
Options opt = new Options();
opt.ComputeReferences = true;
opt.IncludeNonVisibleObjects = true;
opt.View = doc.ActiveView;
foreach (GeometryObject obj in grid.get_Geometry(opt))
{
if (obj is Line)
{
Line line = obj as Line;
if (line.Reference != null)
{
return line;
}
}
}
In version 2017, both methods are failed. Any help is highly appreciated.
BTW, looks like the Revit API is highly UNSTABLE !!!