Avneesh.
02Structural Engineering Automation
← back

project_02

OptiBuild

Flask REST API that auto-generates STAAD.Pro command files and Excel calculation sheets for industrial steel buildings using Indian and American load codes.

● LiveFlask API
Overview

OptiBuild is a Python/Flask REST API that automates the generation of STAAD.Pro structural analysis models for portal-frame industrial steel buildings. An engineer POSTs parametric building data — dimensions, roof type, bay layout, and wind/seismic parameters — and receives back a complete STAAD command file plus an Excel calculation sheet. The system supports both 3D full-building models (/submit) and 2D cross-section frames (/submit_2D), running Flask 3.1.1 deployed as a systemd service on AWS.

Problem

Structural engineers spend hours hand-authoring STAAD.Pro input files for every new portal-frame building project. The geometry, member connectivity, and load combinations must be recalculated from scratch each time, making the process slow, error-prone, and hard to standardise across a team.

Engineering Challenges
01.Computing accurate 3D node coordinates for compound configurations: offset apex, internal columns (IC), canopies, cranes, and mezzanines — each adding new geometry layers.
02.Supporting both Indian (IS 875 / IS 1893) and American (ASCE 7) wind and seismic load code pathways with differing pressure factors, importance factors, and terrain categories.
03.Handling fully dynamic bay spacing where each sidewall and endwall bay can have a different width, while keeping node indexing consistent.
04.Designing a composable NodeMaker → MemberMaker → StaadProcessor pipeline so optional features (cranes, canopies, mezzanines) can be toggled independently without breaking the rest of the model.
05.Providing actionable structured error responses that distinguish input-validation failures from runtime errors, and persisting full context (inputs + traceback) to AWS S3 for post-mortem analysis.
Key Decisions
Flask over FastAPI — dependency-minimal on the self-hosted runner, matching the team's existing Python toolchain.
Geometry separated into discrete NodeMaker sub-packages (ground, eve, apex, brick, IC, canopy, crane, mezz, roof-monitor, cross-bracing) so each segment is independently testable and composable.
openpyxl for Excel output alongside the STAAD command file — matches the sign-off workflow engineers already use for design review.
boto3 + AWS S3 to persist error logs and output files — multi-user concurrent access with no file contention on the server.
GitHub Actions → self-hosted runner → systemd restart on every push to main — continuous delivery without a container layer.
Stack
PythonFlaskNumPyPandasopenpyxlboto3 / AWS S3GunicornGitHub Actionssystemd
Architecture
Key Features
3D & 2D Model Generation Two endpoints — /submit for full 3D STAAD models and /submit_2D for 2D portal-frame cross-sections — sharing the same parametric input schema.
Multi-Roof Type Support Handles gable and offset-apex roof geometries with per-side configurable slopes and custom apex positions.
Composable Structural Add-ons Canopies, overhead cranes, mezzanine floors, internal columns (IC), and roof monitors are optional features that stack cleanly onto any base building.
Dual Load Code Engine Full Indian (IS 875 / IS 1893) and American (ASCE 7) wind, seismic, and load-combination pathways, selectable per request via calculation_type.
Dynamic Bay Spacing Accepts uniform or fully custom bay-width arrays for sidewalls and endwalls independently, with automatic cross-bracing layout adjustment.
Excel Calculation Sheet Output Produces a structured openpyxl workbook alongside the STAAD command text so engineers can review calculations without leaving their existing tools.
Structured Error Reporting Returns typed JSON error responses distinguishing InputError (400) from runtime failures (500), with full inputs and tracebacks written to timestamped log files on AWS S3.
Metrics
50+Buildings Generated
3.1.1Production API Version
2Structural Codes (Indian & American)
< 5sFull 3D Model Generation Time