• 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

PTIMPORT LISP: Import a Coordinate File Into AutoCAD

August 6, 2026

PTIMPORT reads a text file of coordinates and builds geometry from it — survey points from a total station, setting-out data, a traverse, a profile, or anything else that arrives as columns of numbers.

What PointImport does

It will make POINT objects, a chain of lines, a polyline, a 3D polyline, a block at each coordinate, or a copy of anything you select.

Two column orders. XYZ is X, Y and optionally Z, in the natural order. PNEZD is point number, northing, easting, elevation, description — the standard survey exchange order.

With PNEZD the point number and description can be placed as text beside each point, which is what makes a survey drawing readable.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type PTIMPORT and choose the file.
  3. Choose the column order carefully — see below.
  4. Choose what to build: points, lines, a polyline, a 3D polyline or blocks.

How it works

PNEZD is the one that catches people out, because northing comes first and it is the Y axis. A file read as XYZ when it is really PNEZD comes in transposed, and usually a long way from the origin as well, because the point number is being read as an X coordinate.

If your points land in the wrong place with north and east swapped, that is why.

Separators are worked out from the file. Commas, tabs, semicolons or runs of spaces — it looks at the first line with data on it. Blank lines and lines starting with ; or # are skipped, which matters because a trailing blank line is extremely common and is exactly the thing that stops a naive parser dead.

Geometry is built with entmake rather than by feeding every point into one command call. There is no command line length to overflow, and it is far quicker on a large file.

Notes and limits

  • Get the column order right first. Everything else is recoverable; a transposed survey looks plausible and is not.
  • Blank lines and comments are skipped, not treated as errors.
  • Mixed separators are fine as long as the file is internally consistent.
  • One undo group covers the whole import.

Download and details

NamePointImport — read a coordinate file and build geometry from it
DownloadPointImport.lsp — 20.7 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandPTIMPORT
Requiresnothing beyond a CAD platform with AutoLISP.
Source size20.7 KB, 411 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 in either direction, with attributes
  • GRIDSURF LISP — importing a gridded CSV as a surface
  • POLY3D LISP — lifting the imported polyline into 3D
  • 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