Engineering Automation

Python vs AutoLISP for Engineering Automation

A practical comparison of Python and AutoLISP for structural engineering automation: where each language lives, what jobs each should own, and how a small team can choose without a rewrite.

StruTools · 15 May 2026 · 7 min read

Structural teams do not need a language war. They need files moved, drawings cleaned, and tables built without retyping. AutoLISP lives inside AutoCAD and is still the shortest path to selection sets, layers, blocks and attributes. Python lives outside the drawing and is the shortest path to text reports, spreadsheets, folders and analysis output. Most offices eventually want both, not because that is fashionable, but because the jobs sit on different sides of the DWG, and forcing one language across that boundary usually costs more than a dull export file.

The mistake is to pick a language from a tutorial and then drag every problem into it. Parsing a STAAD.Pro result file in AutoLISP is possible and unpleasant. Pushing a layer state in Python through a COM bridge is possible and brittle on a locked CAD licence. Put the job next to the file it touches. If the file is a drawing, start with LISP. If the file is a report, a CSV or a folder of PDFs, start with Python or a structured workbook. You can connect them later with a simple export.

This comparison is written for engineers and CAD leads, not for software departments. It assumes a working AutoCAD standard, occasional STAAD.Pro output, and Excel already on the machine. It points to LISP Programs where drawing-side chores are already packaged, and to Excel Programs where a workbook is the better home than either language. For geometry that has to leave analysis and enter CAD, read the model to CAD workflow first so the language choice is serving a hand-off you already understand.

Where each language is at home

JobAutoLISPPython
Select, offset, layer, block, attributeNativeOnly via CAD API / COM
Parse ANL, CSV, TXT, XMLAwkwardNative
Excel read/write beyond a simple dumpLimitedStraightforward
Batch rename PDFs and issue foldersPoor fitStraightforward
Runs when AutoCAD is closedNoYes

Where each language lives

AutoLISP evaluates inside the drawing session. It can see entities the user sees. Python evaluates in a separate process unless you deliberately attach it to CAD. That single fact decides most choices. Drawing-side work wants LISP. Data-side work wants Python.

Teams get into trouble when they try to make one process do both jobs at once on day one. A LISP routine that also parses a 40,000-line analysis listing will be nobody’s to maintain. A Python script that also tries to mimic a drafter’s trim-and-extend sequence will break when the CAD version or the object model changes.

Drawing-side work

If the user is staring at a DWG, LISP is the tool they can run without leaving the editor. Layer cleanup, title-block fill, block insertion, dimension style resets, and viewport setups are this family. They are also the jobs LISP Programs are built around.

  • Purge, audit, and freeze leftover xref layers before plot
  • Fill attributes from a known list
  • Standardise text styles and dimension styles
  • Place a revision triangle on a user selection
  • Batch a simple command across a sheet set the user already has open

Data-side work

Analysis packages write text. Shops send CSVs. Transmittals are folders of PDFs. Python reads those without opening CAD, which matters overnight and on a machine that should not hold a CAD licence. Reaction tables, file renaming, and “find every ANL in this project tree” belong here.

Python is also the better place to talk to Excel when the workbook is more than a dump. Validation, pivoting reactions by load case, and writing a checker-friendly print sheet are data jobs. Sometimes the workbook alone is enough; see Excel Programs before you write a parser you will have to babysit.

Skills on a typical team

A CAD lead who already writes LISP is a better owner of drawing tools than a one-off Python hire who does not open DWGs. A design engineer who already wrangles STAAD output in Excel is a better owner of parsers than a drafter who has never seen an ANL file. Assign ownership by who already touches the file.

PersonLikely home languageUnlikely home language
CAD / detailing leadAutoLISPLong-running data pipelines
Design engineerPython or ExcelEntity-level CAD edits
CheckerNeither — they own proceduresBeing asked to debug either

Handoff between CAD and calculation

The clean pattern is a boring file in the middle: CSV, TXT, or a simple table. Python or Excel writes it. LISP reads it. Or LISP writes a selection dump and Python builds a report. Avoid embedding a full design calculation inside a drawing command.

  1. Agree the column names once and write them at the top of the file.
  2. Keep units in a header, not implied by the script that happened to run.
  3. Fail loudly if a required column is missing.
  4. Archive the handoff file with the drawing issue it fed.

Choosing without a rewrite

If you already have LISP that works, do not rewrite it in Python to modernise it. If you already have a Python parser, do not port it into LISP because the CAD lead is curious. Add a handoff file if the two worlds need each other. Rewrite only when the current tool cannot be run or cannot be understood.

A practical workflow

  1. Name the file the job touches: DWG, ANL, XLSX, PDF folder.
  2. Pick the language that already sits on that file.
  3. If two files are involved, insert a CSV or table rather than a live bridge on day one.
  4. Give the tool an owner who already opens that file in their normal week.
  5. Document how a non-author runs it, in the CAD standard or the project setup note.

Engineering tips

  • Keep LISP routines short and obvious. A 40-line cleaner beats a 400-line framework.
  • In Python, start with the standard library plus a CSV. Add packages only when the job is real.
  • Never hard-code a project path. Ask for a folder or read a config sitting with the CAD standard.
  • Log what was processed. Silent success on the wrong folder is worse than a visible error.

Common mistakes

Driving AutoCAD from Python for a five-command cleanup

The COM bridge will consume more time than the LISP you refused to write. Stay inside the editor for editor work.

Parsing analysis listings with string hacks in LISP

The listing will change format on the next software update. Parse outside CAD, then feed CAD a table.

Rewriting working tools to unify the language

Users care that the layer reset runs. They do not care that both tools are Python.

Hiding calculation in a drawing command

If a LISP routine “designs” a base plate, the checker cannot see the inputs. Put the calculation in a workbook or a printed note.

Checklist

  • Job classified as drawing-side or data-side
  • Language chosen to match the file
  • Owner named from the people who already touch that file
  • Handoff format documented if two tools cooperate
  • Run instructions written for non-authors
  • No project-specific paths baked into the source
  • Sample output archived from a real issue

Frequently asked questions

Is AutoLISP outdated?

It is old. It is also still the language AutoCAD evaluates natively for the chores detailers actually run. Outdated would mean it cannot reset layers. It can.

Should we use .NET or ObjectARX instead?

Only if you have a maintainer who already lives there. For office-scale cleanup and title-block work, LISP remains the smaller hammer.

Can Python replace Excel?

It can, and it should not as a first move. Checkers can open a workbook. Many cannot run a Python environment. Use Python to feed Excel, or to do jobs Excel cannot see, not to hide a table.

What about Dynamo, Grasshopper or similar?

Those are useful in model-based tools when someone owns them. They are not a substitute for LISP in AutoCAD sheet production or for a parser on an analysis listing.

Where this leaves the work

Pick the language that is already standing next to the file. LISP for the drawing. Python or Excel for the listing. A dull table between them when they have to meet. That split is enough for almost all structural office automation.

When the job is CAD hygiene, start from LISP Programs. When the job is a table the checker must read, start from Excel Programs and only then decide whether Python needs to feed it.

This article provides general educational information. Project-specific structural design, calculations and drawings should be reviewed by appropriately qualified engineering professionals and checked against applicable project requirements and standards. StruTools does not replace engineering judgement or professional design review.