Build an AutoLISP Plot Standards Checker
Design a read-only AutoLISP preflight that tells a CAD manager which Layouts violate approved printer, paper and plot-style standards.
Main idea: A standards checker should explain deviations before it tries to repair them.
Best use: Templates, incoming consultant DWGs and pre-issue QA.
Start with the manual workflow
Write the standard as data: approved PC3 names, paper mappings, CTB/STB policy and allowed exceptions.
Before automating a production workflow, review Autolisp Validate Plot Settings Before Batch, AutoCAD Page Setup Manager Explained, and Plot Styles & Lineweights Guide.
Build the automation in small layers
Step 1 — Turn standards into explicit rules
Where: Config list/file
Do this: Write allowed devices, media and plot styles.
Check: Rules are machine-checkable.
Step 2 — Read every Layout
Where: AutoLISP/ActiveX
Do this: Collect current values.
Check: The checker has a complete inventory.
Step 3 — Classify each rule
Where: PASS/WARN/FAIL
Do this: Use clear severity for each deviation.
Check: Users know what blocks issue.
Step 4 — Show exact correction target
Where: Report
Do this: For each failure, print current value and expected value.
Check: The report is actionable.
Step 5 — Keep repair separate
Where: Second command/tool
Do this: Only after the checker is trusted should you add one-click correction.
Check: Audit remains safe and transparent.
Make the standard visible to humans too
If the checker says a Layout failed, the user should see both the current value and the expected value. “FAIL: wrong paper” is much less useful than “FAIL: Layout A101 uses ISO_A1; standard for PC3 X requires ARCH_full_bleed_D.”
That detail also helps maintain the rules. If a printer driver update changes canonical media names, the report immediately shows why every Layout suddenly fails instead of making users assume the LSP is broken.
What the code should control
- Approved device list
- Paper/media mapping
- CTB/STB mode
- StyleSheet
- PlotWithPlotStyles
- Optional viewport lock state
What you should deliberately leave manual at first
Do not use vague rules such as ‘paper should look right’. Every automated rule needs a measurable value.
Failure modes to design for
- Standards are hard-coded without a version.
- Exceptions are treated as errors.
- Canonical paper names differ by device but the checker compares them globally.
- Users cannot tell what value caused the failure.
When this becomes a production tool
Store the rules outside the code once the tool grows: a small configuration file or controlled data table is easier to maintain than editing source for every printer change.
Official Autodesk references
Frequently asked questions
Should a standards checker modify drawings?
The first version should be read-only. That makes deployment and trust much easier.
What is the most important check?
Usually device/PC3, media and plot style, because those directly control output and vary between workstations.
Can viewport locking be part of preflight?
Yes, if locked viewports are an office requirement after scale approval.
Explore more in AutoLISP Plotting & PDF Automation.
