AI assistsWorkflow guide · not independently tested

Build a lot area table from DWG drawings with an AI-written script

For co-ownership or condominium plans, each lot's private area is often measured by hand from closed polylines, minus shafts and columns, with terraces and gardens kept separate. Have Claude or ChatGPT write a short, commented AutoLISP routine (or a Python script using ezdxf on a DXF export) that reads closed polylines on layers you tag, subtracts voids inside each lot and exports one row per lot to Excel. You check the drafting, the tagging and the local measurement rules.

Land Surveyor · Surveying · Claude · ChatGPT · Autodesk AutoCAD · Microsoft Excel

Content updated · Tool links listed below; vendor features and pricing change, so confirm with the vendor

Short answer

Use Claude or ChatGPT (writing AutoLISP or Python): The AI writes a commented AutoLISP routine or ezdxf script that sums tagged closed polylines per lot, subtracts voids, exports a table and lists open or unassigned shapes as warnings. For co-ownership or condominium plans, each lot's private area is often measured by hand from closed polylines, minus shafts and columns, with terraces and gardens kept separate. Have Claude or ChatGPT write a short, commented AutoLISP routine (or a Python script using ezdxf on a DXF export) that reads closed polylines on layers you tag, subtracts voids inside each lot and exports one row per lot to Excel. You check the drafting, the tagging and the local measurement rules. A person still checks: several lots by hand against the drawing; local co-ownership rules decide which areas count.

AI tie-in

Tool: Claude or ChatGPT (writing AutoLISP or Python)

The AI writes a commented AutoLISP routine or ezdxf script that sums tagged closed polylines per lot, subtracts voids, exports a table and lists open or unassigned shapes as warnings.

Prompt 1

Write an AutoLISP routine for AutoCAD (or a Python script using ezdxf on a DXF export; say which you chose) that reads closed polylines on layers LOT, VOID, TERRACE and GARDEN; assigns each to the lot whose ID text (layer LOT-ID) lies inside the LOT boundary; subtracts VOID areas that lie fully inside a lot; and exports CSV columns: lot ID, private area, voids deducted, terrace, garden, polyline count. List open polylines, unassigned shapes and lots without an ID as warnings instead of guessing. Comment every step so I can check it.

Prompt 2

The script gave these results for three lots I measured by hand: [paste script output and my hand values]. Explain each difference by pointing to the step in the script that caused it. Do not change my hand values.

Human check: Several lots by hand against the drawing; local co-ownership rules decide which areas count.

The problem

Build a lot area table from DWG drawings with an AI-written script. This is a common, time-consuming task for a land surveyor.

What this workflow does

For co-ownership or condominium plans, each lot's private area is often measured by hand from closed polylines, minus shafts and columns, with terraces and gardens kept separate. Have Claude or ChatGPT write a short, commented AutoLISP routine (or a Python script using ezdxf on a DXF export) that reads closed polylines on layers you tag, subtracts voids inside each lot and exports one row per lot to Excel. You check the drafting, the tagging and the local measurement rules.

How it works: AI drafts or analyzes. A person operates the tools, checks the work, and takes action.

Your checkpoint: Open, overlapping or duplicated polylines give wrong areas without any error, so spot-check several lots by hand. Which areas count, and how they are weighted, follows your local co-ownership rules, not the script.

Before you start

  • Access to the named tool; confirm license, version and cost with the vendor.
  • A small, non-confidential sample to try the workflow on first.
  • A qualified person to review the output before it is used.

Tools and access

Follow the steps

  1. Set a layer convention first: one layer per area type (lot boundary, void, terrace, garden) and a lot ID text inside every lot boundary.
  2. Ask Claude or ChatGPT for an AutoLISP routine, or a Python script using ezdxf on a DXF export, that reads closed polylines by layer and assigns each one to the lot whose ID text sits inside it.
  3. Have it subtract void polylines that fall fully inside a lot, report terraces and gardens in their own columns, and list open polylines as warnings instead of closing them.
  4. Export a CSV or Excel table: lot ID, level, private area, voids deducted, terrace, garden and polylines used, plus a list of unassigned shapes and lots with no ID.
  5. Run it on a drawing you already measured by hand and compare lot by lot before you use it on a new one.
  6. Apply your local co-ownership rules (which spaces count and any weighting) in Excel afterward. The script only measures what is drawn.

Try a small example

Replace the bracketed fields with your own project details. No tested sample run is published for this workflow yet.

Sample input

Fill in the bracketed [fields] in the text below with your project data.

Starter prompt

Write an AutoLISP routine for AutoCAD (or a Python script using ezdxf on a DXF export; say which you chose) that reads closed polylines on layers LOT, VOID, TERRACE and GARDEN; assigns each to the lot whose ID text (layer LOT-ID) lies inside the LOT boundary; subtracts VOID areas that lie fully inside a lot; and exports CSV columns: lot ID, private area, voids deducted, terrace, garden, polyline count. List open polylines, unassigned shapes and lots without an ID as warnings instead of guessing. Comment every step so I can check it.

Expected output

Not published yet. Treat any output as a draft and check it against the source documents.

Check the result

  • Every value, citation or quantity traces back to a source document.
  • Missing information is marked as missing, not filled in.

Limits and recovery

  • Open, overlapping or duplicated polylines give wrong areas without any error, so spot-check several lots by hand. Which areas count, and how they are weighted, follows your local co-ownership rules, not the script.
  • Check your organization’s data policy before sharing project files with third-party tools.

Stop or switch when: The source cannot be verified, permissions are missing, or the result contains unsupported facts.

Frequently asked questions

How does AI help with this?

Claude or ChatGPT (writing AutoLISP or Python): The AI writes a commented AutoLISP routine or ezdxf script that sums tagged closed polylines per lot, subtracts voids, exports a table and lists open or unassigned shapes as warnings. A person still checks: Several lots by hand against the drawing; local co-ownership rules decide which areas count.

How do I build a lot area table from DWG drawings with an AI-written script?

Set a layer convention first: one layer per area type (lot boundary, void, terrace, garden) and a lot ID text inside every lot boundary. Ask Claude or ChatGPT for an AutoLISP routine, or a Python script using ezdxf on a DXF export, that reads closed polylines by layer and assigns each one to the lot whose ID text sits inside it. Have it subtract void polylines that fall fully inside a lot, report terraces and gardens in their own columns, and list open polylines as warnings instead of closing them. The full step list is above.

Does this use an AI agent or regular software?

It is labeled AI assists: AI drafts or analyzes. A person operates the tools, checks the work, and takes action.

What tools do I need?

Claude, ChatGPT, Autodesk AutoCAD, Microsoft Excel. Confirm license, version and cost with the vendor, and try it on a small non-confidential sample first.

Has this workflow been tested?

Workflow guide · not independently tested. Written from vendor documentation and practitioner use. Labels apply to the steps described here, not every feature of a product. Links were checked when the page was written.

Evidence and maintenance

Written from vendor documentation and practitioner use. Labels apply to the steps described here, not every feature of a product. Links were checked when the page was written.

Know what does the work.

Agent executes
An AI agent calls connected tools to carry out bounded actions. You set permissions and review the result.
AI assists
AI drafts or analyzes. A person operates the tools, checks the work, and takes action.
Conventional automation
Rules or specialist software perform the task. No AI agent is required.