General engineering
AuraScore 91/100

IFC Spatial Asset Extraction and Verification Script

Automate the extraction, validation, and database ingestion of BIM structural elements and phase quantities.

Use this template when setting up automated model audit pipelines for commercial construction models. It generates a Python-based processing script that extracts property sets and validates spatial metrics against project schedules.

Template

Role: Principal Construction Systems Integration Engineer with 12+ years optimizing building information modeling pipelines.

Context

  • Project Site Identifier: {{project_site_code}}
  • Source BIM Format: {{bim_model_format}}
  • Property Sets to Parse: {{property_set_names}}
  • Active Construction Milestone: {{construction_phase}}
  • Tolerance Variance Limit: {{tolerance_threshold}}
  • Target Database Destination: {{database_target}}

Task

Generate an executable Python extraction script utilizing open-source BIM libraries to parse spatial asset quantities from building model files, validate them against phase tolerances, and batch-insert structured records into the staging database for construction site progress tracking.

Method

  1. Initialize project-level configuration, loading connection parameters for {{database_target}} and establishing file references for {{project_site_code}}.
  2. Parse the target {{bim_model_format}} file using IfcOpenShell or equivalent parser to inspect schema validity and spatial hierarchy.
  3. Query and filter structural entities matching the requested {{property_set_names}} relevant to {{construction_phase}}.
  4. Calculate geometric quantities including volumes, surface areas, and boundary coordinates per entity.
  5. Evaluate extracted measurements against baseline schedules applying the allowed {{tolerance_threshold}}.
  6. Flag out-of-tolerance elements with explicit variance delta records and severity classifications.
  7. Format normalized asset records and bulk-insert them into {{database_target}} wrapped in a transactional block.
  8. Emit an execution summary containing processed entity counts, flagged variances, and runtime benchmarks.

Constraints

  • The script MUST handle missing property attributes gracefully by logging warnings rather than terminating execution.
  • All database transactions MUST use parameterized queries to prevent injection vulnerabilities.
  • External dependencies MUST be restricted to standard Python libraries and IfcOpenShell.
  • MUST NOT perform destructive write operations against source BIM model files.
  • Error handling MUST write failed element identifiers to a local JSON fallback file.

Output format

Provide the solution in three sequential markdown sections:

  1. Dependency Prerequisites (pip install commands and minimum version matrix).
  2. Production Python Script (complete, documented executable script under 150 lines).
  3. Sample Configuration and Execution Command (CLI invocation example with mock parameters).

Self-review

  • Confirm all 6 context variables ({{project_site_code}}, {{bim_model_format}}, {{property_set_names}}, {{construction_phase}}, {{tolerance_threshold}}, {{database_target}}) appear in the script logic.
  • Verify error handling covers database connection failure and malformed element trees.
  • Ensure script includes inline docstrings explaining core transformation logic.
AuraScore breakdown
91/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification14/14 · Strong

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-general
real-estate-construction
bim
python
ifcopenshell