Exporting¶
Import and export live in the File menu — Import… brings a model in from another tool, Export… writes the model out to a CAD/analysis format, and the report/table/drawing commands below produce deliverables.
Drawing¶
File → Print Graphics… (Ctrl+E) saves the current canvas as PNG, SVG, or PDF, with options for resolution (PNG), transparency, tight bounding box, and grid visibility.
Report — Write Report…¶
File → Write Report… (Ctrl+Shift+W) is the main report command. A single dialog lets you choose the format and the content:
- Format — PDF (paginated A4, each case/combination on a new page, with
title, timestamp and page number), Word (
.docx, editable — needspython-docx), or Excel (.xlsx— needsopenpyxl). - Content — any mix of: project info; the structure and loads drawings; the model tables; the result tables; the result views (deformed, diagrams, stress, …) for the cases you tick; and the design views. Result content requires a solved model.
Tables to Excel — Write Tables to Excel…¶
File → Write Tables to Excel… (Ctrl+Shift+T) is the one-click shortcut: the
model tables — plus the result tables if the model has been solved — go straight
into a single .xlsx workbook, with no dialog. Headers are bold with frozen panes
and auto-fit columns; sheets with no data are omitted.
Model sheets:
| Sheet | Contents |
|---|---|
| Materials | E, γ, α, unit mass |
| Sections | material, b, h, area, inertia |
| Nodes | ID, X, Y |
| Elements | ID, node i/j, section, hinges |
| Supports | node, support, UX/UY/TZ |
| Node / Element springs | stiffnesses |
| Load cases | ID, action type, self-weight factor |
| Point / Distributed / Temperature loads, Settlements, Nodal masses | per load case |
| Analysis cases | ID, type, coefficients, modal/spectrum/stored-K |
| Combinations | ID, type, analysis-case coefficients |
| Spectral functions | ID, description, damping, (T, Sa) points |
Result sheets (when solved):
| Sheet | Columns |
|---|---|
| Displacements | Case type, Case, Node, ux, uy, rz |
| Reactions | Case type, Case, Node, Rx, Ry, Mz (with a bold Σ row per case) |
| Constraint forces | Case type, Case, Node, Fx, Fy, Mz (only if the model has constraints) |
| Element forces | Case type, Case, Element, End (i/j), N, V, M |
| Span extremes | Case, Element, |N|max, |V|max, M⁺, M⁻ |
| Reaction sums | Case type, Case, ΣRx, ΣRy, ΣMz |
| Modal | Case, Mode, ω, f, T, Meff_X%, Meff_Y%, Cum X%, Cum Y% |
CAD and other tools¶
File → Export… writes the model to one of several interchange formats; the chosen file filter drives the target:
| Format | Extension | Direction |
|---|---|---|
| SAP2000 text | .s2k |
export and import |
| DXF drawing | .dxf |
export and import |
| IFC (openBIM) | .ifc |
export and import |
| Autodesk Robot text | .str |
export |
| Python build script | .py |
export — includes variants, support sets, variant combinations, and construction sequences |
DXF exports the geometry as a drawing and imports a drawing back into a model
(lines become bars); it is the bridge to general CAD. Robot export writes the
Autodesk Robot Structural Analysis text format. The Python export writes a
script that rebuilds the model with the xdfem2d API — handy for versioning or
programmatic edits — including variants, support sets, variant combinations, and
construction sequences with all their phases and operations. Import… reads
SAP2000 .s2k, DXF, or IFC.
SAP2000 (.s2k)¶
xdfem2D can export to and import from the SAP2000 text interchange format
(.s2k). The 2-D model is mapped to a planar SAP model in the X–Z plane
(xdfem2D X → SAP X, xdfem2D Y → SAP Z), with the out-of-plane DOFs deactivated.
This is a best-effort exchange — open the file in SAP2000 and verify a simple
case (especially moment/temperature sign conventions).
What is exchanged:
| xdfem2D | SAP2000 |
|---|---|
| Load case | Load pattern (SAP auto-creates its Linear Static case) |
| Linear analysis case | Linear Static case |
| NonLinear analysis case (unilateral springs) | Nonlinear Static case (no P-Delta) |
| Geometric Nonlinear (P-Delta) | Nonlinear Static case (P-Delta) |
| Modal / Spectrum / Mass | Modal / Response-Spectrum case + Mass Source |
| Combination (LinearSum) | Linear-Add combination |
| Node spring | Joint spring (uncoupled, bilateral only) |
| Element (Winkler) spring | Frame line spring; tension-/compression-only mode maps to the SAP "SimpleType" |
| Concrete materials | EC2 (Eurocode 2-2004) design data: concrete strength, rebar material, per-frame design procedure, section cover, and design preferences (γc, γs, αcc) |
Unilateral node springs
SAP joint springs are linear/bilateral, so a node spring's tension-/compression-only mode is not exported. Use a compression-/tension-only element spring (or a nonlinear link in SAP) to model unilateral support along a member. Element-spring modes round-trip both ways.
Concrete design under Eurocode 2
When the model carries concrete materials, the export sets the concrete frame
design code to Eurocode 2-2004 and marks the load combinations for concrete
design, so SAP runs the RC design under EC2. Importing a .s2k reads the
concrete strength, safety factors and per-frame design flag back into xdfem2D.
IFC (.ifc)¶
xdfem2D can export to and import from IFC — the openBIM ISO 16739 exchange
format — using the structural-analysis view (IfcStructuralAnalysisModel).
This is the branch of IFC meant for finite-element exchange, so it mirrors the
xdfem2D model closely; it is not the physical/architectural model (IfcBeam,
IfcSlab, …). IFC support needs the optional ifcopenshell package — install
the engine with the ifc extra (pip install "xdfem2d[ifc]"); the desktop app
already includes it.
Values use the same unit convention SAP2000 itself writes — kN, m, tonne, °C (force in kilonewtons, mass in tonnes, temperature in degrees Celsius) — with every unit, including the derived ones for elastic modulus, mass density, thermal expansion and line/area force, declared in the file so importers resolve the material and load units without warnings. Only nodes attached to a member are written (an isolated node is not a valid structural point connection).
The 2-D model is placed in 3-D space by domain, following the SAP2000 convention: a plane model lies in the global X–Z plane (Y = 0) and a plate model in the X–Y plane (Z = 0). On import the plane is detected from the geometry and the domain inferred (X–Z → plane, X–Y → plate).
What is exchanged:
| xdfem2D | IFC (structural analysis) |
|---|---|
| Model | IfcStructuralAnalysisModel |
| Node | IfcStructuralPointConnection |
| Bar element | IfcStructuralCurveMember (+ IfcProfileDef for the section) |
| Triangle / quad | IfcStructuralSurfaceMember (thickness carried) |
| Material | IfcMaterial + Pset_MaterialMechanical (E, ν, density) |
| Support | IfcBoundaryNodeCondition on the point connection |
| Load case | IfcStructuralLoadCase |
| Nodal load | IfcStructuralPointAction |
| Bar distributed load | IfcStructuralLinearAction |
| Area (slab) pressure | IfcStructuralPlanarAction |
Domain choice on import
If the geometry does not identify a plane (for example a single line of nodes), the importer asks whether to read the file as a plane or a plate model, just like the SAP2000 import. A genuinely three-dimensional IFC model (nodes varying out of a single plane) cannot be imported as a 2-D model and is reported rather than silently flattened.
Best-effort exchange
A trapezoidal bar load is exported at its mean intensity, and the FE mesh of a slab is exchanged as its surface members (re-meshed on import). Open the file in an IFC viewer and verify a simple case before relying on it.
Physical-model files
Many BIM tools export only the physical model (IfcBeam, IfcColumn,
IfcSlab, …) with no structural-analysis model. When you import such a file,
xdfem2D offers to bring in the geometry only — beam/column centre-lines as
drawing polylines and slab/wall outlines as polygon regions — with no supports,
loads, materials or sections. It is a drafting aid to trace over, not an
analysis import.