PQC LISP: Quality-Check Closed Polygons (Free AutoLISP Download)
PQC is a dedicated pre-GIS-export QA check. A polygon in AutoCAD can look mathematically closed (start and end points coincide) while its actual Closed property is still set to No, meaning GIS software may treat it as invalid, open geometry. AutoCAD's native overlap-checking tools don't test for this specific issue; PQC does, and reports the total area of everything that's genuinely closed.
POLYQC-bgol (Quality-Check Closed Polygons)
Command Type: AutoLISP routine (works in AutoCAD, BricsCAD, ZWCAD and most AutoLISP-compatible CAD platforms)
Developed by: BGol Community, bgol.in
Inspired by the general concept of closed-polygon QA utilities used in CAD-to-GIS drafting. This is an original, independently written routine, new file name, new command name, new source code, created so the CAD community has a free, editable, open-source alternative.
Overview
PQC is a dedicated pre-GIS-export QA check. A polygon in AutoCAD can look mathematically closed (start and end points coincide) while its actual Closed property is still set to No, meaning GIS software may treat it as invalid, open geometry. AutoCAD's native overlap-checking tools don't test for this specific issue; PQC does, and reports the total area of everything that's genuinely closed.
How to Use
- Load
POLYQC-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
PQCat the command line and press Enter. - Select one or more polyline entities intended to represent polygons.
- Each polyline's true DXF
Closedflag is checked (not just visual appearance). A small marker circle is placed at each polyline's first vertex on layerBGOL-PQC, green for genuinely closed, red for not. - The command line reports how many were checked, how many are truly closed, and the total area of the closed objects.
- A CSV report (
BGOL-PQC-AreaTable.csv, saved next to the current drawing) lists each polyline's handle, closed status, and area.
Why Use It
- Catches a specific, easy-to-miss data-quality problem, visually closed but property-wise open polylines, that would otherwise cause failures or incorrect topology when importing into a GIS system.
- Provides a quantifiable check (total area of confirmed-closed objects) as part of the QA process, rather than just a pass/fail flag.
- CSV export creates a documented record of the QA check, useful for audit trails or team review before committing to a GIS export/import step.
- Complements (rather than duplicates) AutoCAD's native overlap-detection tools, covering a gap those tools don't address.
Where to Use It
- Pre-export quality assurance for any CAD-to-GIS workflow where "polygon" is a meaningful, topology-relevant object (land parcels, building footprints, zoning boundaries, etc.).
- Any drafting QA step needing to programmatically verify closed status across many polylines at once rather than manually checking Properties for each one.
- Preparing cadastral, land-use, or infrastructure drawings for GIS integration where invalid open polygons would break downstream processing.
Notes
- Only LWPOLYLINE entities are checked; other entity types in the selection set are ignored.
- Area is computed only for polylines whose Closed flag is genuinely set; visually-closed-but-flag-open polylines get a red marker and a 0.000 area row in the CSV, flagging them for correction (e.g., re-drawing with
PEDITโClose). - Source code is fully open, feel free to study, modify, and redistribute it under the same open, free-for-all spirit.
Credits
Developed and shared for the CAD community by BGol Community. Website: https://bgol.in/ Free and open-source, use it, modify it, share it, for personal or commercial work alike.
Frequently Asked Questions
PQC is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Only LWPOLYLINE entities are checked; other entity types in the selection set are ignored.
Catches a specific, easy-to-miss data-quality problem, visually closed but property-wise open polylines, that would otherwise cause failures or incorrect topology when importing into a GIS system.
Yes. PQC is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.
Drag and drop POLYQC-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type PQC at the command line to run it.
๐ค About BGol Community
BGol Community of Advanced Surveying builds and shares free, open-source tools for the survey and CAD drafting community.
๐ Made with โค๏ธ by BGol Community of Advanced Surveying
Free, open-source, and built for the CAD community, for personal or commercial use, always.