{"slug": "measure-your-drawing-set-before-you-pilot-an-ai-drawing-reader", "title": "Measure your drawing set before you pilot an AI drawing reader", "summary": "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.", "body_md": "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.\n\nThis post is the engineer's version of our guide on [AI for construction drawings](https://dev-station.tech/ai-construction-drawings/). It turns the first two checks from that guide into scripts you can run before any vendor sees your files.\n\nA 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.\n\n``` python\nimport fitz  # PyMuPDF\nfrom pathlib import Path\n\ndef has_text_layer(pdf_path, min_chars=200):\n    with fitz.open(pdf_path) as doc:\n        page = doc[0]\n        return len(page.get_text().strip()) >= min_chars\n\nsheets = list(Path(\"drawings\").glob(\"*.pdf\"))\nvector = [p for p in sheets if has_text_layer(p)]\nprint(f\"{len(vector)} of {len(sheets)} sheets have a text layer\")\n```\n\nThe `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.\n\nIf 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.\n\n``` python\nimport re\nfrom collections import defaultdict\n\npattern = re.compile(r\"^(?P<number>[A-Z]{1,2}-\\d{3})[_-]?(?P<rev>[A-Z0-9]+)?\")\nby_number = defaultdict(list)\nfor p in sheets:\n    m = pattern.match(p.stem)\n    if m:\n        by_number[m[\"number\"]].append(m[\"rev\"])\n\ndupes = {k: v for k, v in by_number.items() if len(v) > 1}\nprint(dupes)\n```\n\nAdjust 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.\n\nThe full guide covers the 4 jobs AI is sold for and the 5 document problems behind most failed pilots: [AI for construction drawings](https://dev-station.tech/ai-construction-drawings/).", "url": "https://wpnews.pro/news/measure-your-drawing-set-before-you-pilot-an-ai-drawing-reader", "canonical_source": "https://dev.to/devstation026/measure-your-drawing-set-before-you-pilot-an-ai-drawing-reader-3b1j", "published_at": "2026-12-03 09:41:42+00:00", "updated_at": "2026-12-03 09:46:40.761467+00:00", "lang": "en", "topics": ["ai-tools", "artificial-intelligence"], "entities": ["PyMuPDF"], "also_reported_by": [], "takeaway": "Before piloting an AI drawing reader, script a text-layer check with PyMuPDF and a revision-duplicate scan on filenames, since scanned sheets and superseded revisions—not model errors—cause most extraction failures.", "recommendation": {"advice": "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.", "playbook": "training-data", "playbook_url": "https://wpnews.pro/playbooks/training-data"}, "alternates": {"html": "https://wpnews.pro/news/measure-your-drawing-set-before-you-pilot-an-ai-drawing-reader", "markdown": "https://wpnews.pro/news/measure-your-drawing-set-before-you-pilot-an-ai-drawing-reader.md", "text": "https://wpnews.pro/news/measure-your-drawing-set-before-you-pilot-an-ai-drawing-reader.txt", "jsonld": "https://wpnews.pro/news/measure-your-drawing-set-before-you-pilot-an-ai-drawing-reader.jsonld"}}