GRIDSURF reads a CSV of gridded levels and builds either a 3D mesh or a cloud of 3D points from it. It is aimed at survey and site data, where the levels arrive as a regular grid and getting them into the drawing is the tedious part.
What GridSurface does
The expected file format is a plain rectangular grid of Z values — nothing else. Each line is one row of the grid, each comma-separated field is one Z value:
12.40,12.55,12.71,12.90
12.38,12.51,12.68,12.85
12.31,12.44,12.60,12.77
There are no X and Y columns, because they are not needed: the position of a value within the grid supplies them. Column index times cell width gives X, row index times cell height gives Y, and the value itself is Z. You are asked for the cell size when the file loads.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Prepare the CSV as a plain rectangular grid of Z values, with no header row and no coordinate columns.
- Type
GRIDSURFand choose the file. - Give the cell size — the spacing between grid positions.
- Choose mesh or points.
How it works
A 3D polygon mesh is limited by AutoCAD to 256 vertices in each direction, so a grid larger than 255 × 255 can only be drawn as points. The routine checks this before offering the choice and says so plainly, rather than accepting the file and failing part way through building it.
Points are the safer option for very large or noisy data. A mesh is what you want if the surface is going to be rendered, sectioned or used as a drape.
If you choose points and cannot see them afterwards, that is PDMODE rather than a failure — set it to 3 and PDSIZE to -1, then REGEN. A point at the default PDMODE of 0 is a single pixel and effectively invisible on a site plan.
Notes and limits
- The CSV must contain Z values only. Header rows and X/Y columns will be read as levels.
- Meshes are capped at 255 × 255. Anything larger must be points, and the routine tells you before you commit.
- Set PDMODE to 3 and PDSIZE to -1 if the imported points appear to be missing.
- The grid must be regular. Irregular survey data needs a different tool — the whole method depends on position implying coordinates.
Download and details
| Name | GridSurface — import a CSV grid of levels as a mesh or 3D points |
| Download | GridSurface.lsp — 11.9 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | GRIDSURF |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 11.9 KB, 305 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| Compatibility | AutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer. |
| Author | YZ, August 2026 |
| Licence | Free to use, supplied “as is” with no warranty. |
References
- POINTBRIDGE LISP — moving point data between drawings and files
- VPGRID LISP — survey coordinate grid over a viewport
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program