• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

GRIDSURF LISP: Import a CSV Grid as a Mesh or 3D Points

August 3, 2026

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

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Prepare the CSV as a plain rectangular grid of Z values, with no header row and no coordinate columns.
  3. Type GRIDSURF and choose the file.
  4. Give the cell size — the spacing between grid positions.
  5. 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

NameGridSurface — import a CSV grid of levels as a mesh or 3D points
DownloadGridSurface.lsp — 11.9 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandGRIDSURF
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size11.9 KB, 305 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
CompatibilityAutoCAD (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.
AuthorYZ, August 2026
LicenceFree 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

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in