From Text File to Force Diagram
In the previous article we showed how the text files used by CSI software (SAP2000's .s2k) make it possible to automate model creation: groups, section cuts, all generated by routines written with the help of AI. Today we close the loop from the opposite end: querying results.
The starting observation is simple and, for many users, surprising: when you export a solved model to .s2k with the results tables included, that text file contains everything: the geometry, the section cuts, the forces for every combination, station by station. No API required, no intermediate Excel, no need to even open SAP2000. It is a file that any program (or any AI) can read.
|
The scope of the tool
What we asked the AI for was a results-browsing routine with one clear interaction rule: first you pick the structural element, and only then is the force view generated. The result is a single HTML file that opens in the browser, with the building's floor plan drawn automatically from the geometry in the .s2k itself: slab outline, beams, columns, and walls, each identified by the type of finite element that models it.
Better than describing it is letting you test it: the actual tool is embedded right below.
From there, every click generates the corresponding view, with two distinct and deliberate behaviors:
Core and walls: forces come from the section cuts defined in the model (the naming convention from the previous article: PAR_P3_inf, and so on). These are the six integrated forces F1, F2, F3, M1, M2, M3 over the height, with the Max/Min envelope of the combinations.
Columns: here we do not use section cuts. Each column is individually clickable and its diagram (P, V2, V3, T, M2, M3) comes straight from the frame element forces, station by station. Interestingly, the routine detected that the "columns" section cut in the original model was cutting all the columns at once, which is useful as a global story cut but redundant once each column has its own diagram, so it is hidden automatically (with an option to keep it).
How simple it is, in practice
Here is the point we want to drive home: we did not write a single line of code. The "source code" of this tool was a set of requests like these:
|
Three iterations in plain language, each one refining the previous. The AI took care of reading the tables, rebuilding the floor plan, handling sign conventions, and generating the interface. Our test file was 374 MB; the routine processes it in about 1.5 seconds, with nothing to install beyond Python.
The anatomy of the .s2k file
To understand how the algorithm fetches the results, it helps to look inside the file. An .s2k exported from a solved model is simply a sequence of tables, the same ones you see in SAP2000 under Display > Show Tables, written as text, with key=value records. The model definition comes first, the results at the end:
|
Everything is in plain sight: the geometry tables give you the floor plan, the naming convention (PAR_P1_inf = wall, story 1, bottom cut) gives you the organization over the height, and the two results tables give you the numbers. That is why validation is so direct: what the tool draws is literally what sits in these lines.
A taste of the algorithm
With the structure in front of us, the heart of the extraction, exactly as the AI wrote it, fits in half a dozen lines: stream through the file (which is why 374 MB is no trouble) and catch the right table:
|
The rest follows exactly the same logic, and was all written by the AI from the requests above: joining continuation lines (ending in _), rebuilding the floor plan from the geometry tables, reading the frame forces for the columns, and generating the interactive HTML. There is no magic: there is a well-documented text format and a patient machine reading it.
The usefulness is immediate: quick force lookups without opening the model, shareable views for colleagues or reviewers (it's an HTML file, so it opens on any machine), and a foundation that adapts to any model following the same section cut naming convention.
The risks and why they are traceable here
It would be irresponsible to present this without the other half of the story. A routine written by AI can be wrong, and in structural results a silent error is dangerous. While developing this tool we ran into concrete examples: the "sup" cuts return forces with the sign flipped (they are the equilibrium of the opposite side of the cut), and in envelopes that flip swaps Max with Min, a subtlety a naive implementation would get wrong without anyone noticing.
|
This is the boundary we recommend: use AI to automate the reading, organization, and visualization of results, where every number is traceable back to its origin and verification costs minutes, and keep the engineer responsible for validation and interpretation. The tool decides nothing; it shows, faster and better, what the model has already calculated. Design responsibility is not something you delegate.