cd /news/ai-tools/measure-your-drawing-set-before-you-… · home › topics › ai-tools › article
[ARTICLE · art-180891] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=· neutral

Measure your drawing set before you pilot an AI drawing reader

An engineer published Python scripts that let construction teams audit their drawing sets before piloting an AI drawing reader, using PyMuPDF to detect whether PDFs carry a text layer and a regex pass to flag duplicate sheet numbers across revisions. The scripts surface two common causes of failed pilots: scanned sheets that require OCR and superseded revisions that inflate quantity extraction. The engineer recommends sampling around thirty sheets across disciplines and tuning the text-layer character cutoff by hand.

recommendation

Audit your drawing set first: flag PDFs lacking a text layer and duplicate sheet numbers, then sample about thirty sheets by hand before trusting any vendor accuracy claim.

more in playbook: Fine-tuning and data
by read2 min views4 publishedDec 3, 2026

Every AI drawing reader demo uses a clean plan exported from CAD. Your project folder is different. It has scans, superseded sheets and a symbol legend somebody invented years ago.

This post is the engineer's version of our guide on AI for construction drawings. It turns the first two checks from that guide into scripts you can run before any vendor sees your files.

A vector PDF still carries text as text and lines as objects with coordinates. A scanned sheet is an image, so every word has to come back through OCR. A quick way to sort them is to ask the PDF for its text layer.

import fitz  # PyMuPDF
from pathlib import Path

def has_text_layer(pdf_path, min_chars=200):
    with fitz.open(pdf_path) as doc:
        page = doc[0]
        return len(page.get_text().strip()) >= min_chars

sheets = list(Path("drawings").glob("*.pdf"))
vector = [p for p in sheets if has_text_layer(p)]
print(f"{len(vector)} of {len(sheets)} sheets have a text layer")

The min_chars cut-off is a guess you should tune. A title block alone can carry some text, so open a few borderline sheets by hand. Sample around thirty sheets across disciplines. If most come back as images, budget for a recovery step and ignore any quoted vendor accuracy.

If three revisions of M-101 sit side by side, a quantity extraction counts all three. That looks like a software bug. It is a file management problem, and a few lines find it.

import re
from collections import defaultdict

pattern = re.compile(r"^(?P<number>[A-Z]{1,2}-\d{3})[_-]?(?P<rev>[A-Z0-9]+)?")
by_number = defaultdict(list)
for p in sheets:
    m = pattern.match(p.stem)
    if m:
        by_number[m["number"]].append(m["rev"])

dupes = {k: v for k, v in by_number.items() if len(v) > 1}
print(dupes)

Adjust the pattern to your own numbering. If it fails on half the files, that is your third finding: the drawing numbers do not follow a convention.

The full guide covers the 4 jobs AI is sold for and the 5 document problems behind most failed pilots: AI for construction drawings.

── more in #ai-tools 4 stories · sorted by recency
── more on @pymupdf 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/measure-your-drawing…] indexed:0 read:2min 2026-12-03 · —