|

How to Test AutoLISP Plotting Scripts Safely Before Production

Build a small plotting test drawing and a repeatable checklist before an AutoLISP routine touches real project sheets.

Main idea: A plotting routine is only as trustworthy as the test drawing and verification process used before deployment.

Best use: Any free or premium LSP that changes Page Setups, viewports, CTB/STB, devices or PDF output.

Start with the manual workflow

Create a compact test DWG with two or three Layouts, known paper sizes, one CTB/STB standard, a few lineweights, a scale bar and at least one viewport.

Build the automation in small layers

Step 1 — Create the baseline DWG

Where: A dedicated test folder

Do this: Save a copy with known-good Layouts and PDF output.

Check: You have a file you can reset after every test.

Step 2 — Record expected values

Where: Simple checklist

Do this: Write down device, paper, plot style, Layout scale and expected PDF name.

Check: The expected result is objective.

Step 3 — Run one command

Where: APPLOAD + command line

Do this: Test the routine on only one operation first.

Check: The first change is easy to inspect.

Step 4 — Compare output

Where: Plot Preview / PDF / Properties

Do this: Check the exact values the routine claims to control.

Check: A pass/fail decision is possible.

Step 5 — Reset and repeat

Where: Fresh copy of the baseline

Do this: Run the same test again before testing additional releases or workstations.

Check: The result is repeatable.

Create one permanent regression drawing

Your test DWG should contain more than one easy sheet. Include at least two paper sizes, two viewport scales, a lineweight sample, a screened color, a raster image or xref if your office uses them, and a file name that contains spaces. That catches assumptions that a perfect one-sheet sample will never reveal.

Keep a known-good PDF beside the DWG. After a code change, compare page size, scale, lineweight hierarchy, orientation and file names. A small repeatable regression set is what eventually lets you replace “it seems to work” with a real compatibility statement.

What the code should control

  • Baseline DWG
  • Known-good PDF
  • Expected settings checklist
  • Version/release matrix
  • Rollback copy

What you should deliberately leave manual at first

Do not call a routine ‘tested’ just because the source code looks correct. Runtime testing must include the actual AutoCAD release and output environment you claim to support.

Failure modes to design for

  • Testing only on one perfect drawing.
  • Testing PDF output but not existing-file behavior.
  • Ignoring AutoCAD LT or Mac compatibility limits.
  • Changing the test file between releases so results are not comparable.

When this becomes a production tool

Keep the test drawing with the code. Every code change should be rerun against the same baseline before the download version number is increased.

Official Autodesk references

Frequently asked questions

What should a plotting test drawing contain?

At minimum: multiple Layouts, known paper sizes, a plot style table, lineweight variation, one or more viewports and a known scale reference.

Should I test on the newest AutoCAD only?

No. Test every release you claim in the compatibility table.

Can static code review replace AutoCAD testing?

No. Static checks can catch source mistakes, but printer/PC3 behavior and real plot output require runtime testing.

Explore more in AutoLISP Plotting & PDF Automation.