Access and Edit existing grid surface

I am currently working on a civil 3D plugin in .NET C# that trims the Gridsurface to a specified elevation. This plugin can be utilized either under Dynamo or as a new command within Civil 3D. The Gridsurface is generated from a DEM text file. I have several options to consider for accessing and manipulating the data, and I would greatly appreciate your insights and recommendations. Here are the approaches I am considering:

  1. Modifying the vertex collection directly by accessing and manipulating its data.

  2. Extracting the vertex data, exporting it to a new text file (or utilizing in-memory storage), performing the required modifications, and then importing it back as a new Gridsurface.

  3. Working with the cells collection, applying similar steps as mentioned above.

If possible, I would highly appreciate any advice, suggestions, or code snippets based on your experience in this field.