FCS Output and Reporting
FCS scripts can produce structured text reports (FCS.Reporting), raw images, and DXF drawings. This document covers all three.
1. FCS.Reporting — Structured Calculation Report
1.1 Document tree overview
A report is a tree of Chapter and Paragraph / Formula nodes. The top-level variable must be named so the FLI renderer picks it up.
report := FCS.Reporting.Chapter{
Title = "My Report",
Children = [
childChapter1,
childChapter2
]
}
1.2 FCS.Reporting.Chapter
ch := FCS.Reporting.Chapter{
Title = "Section title",
Children = [
...paragraphs and sub-chapters...
]
}
Chapters can be nested to any depth.
1.3 FCS.Reporting.Paragraph
Two equivalent syntaxes:
# Object syntax
para := FCS.Reporting.Paragraph{
TextFn := rw => "The beam width is " + rw.SVu(beamWidth) + "\n"
}
# Constructor shorthand
para := FCS.Reporting.Paragraph(rw => "Introduction text")
The rw argument is a report writer passed in at render time; call its methods to format engineering quantities.
1.4 FCS.Reporting.Formula
Renders an equation block (centered, with equation number):
FCS.Reporting.Formula(rw => rw.SD(Check.sigma_t_0_d))
FCS.Reporting.Formula(rw => rw.SEVu(Check.sigma_t_0_d))
1.5 Report Writer (rw) Methods
| Method | Output | Example |
|---|---|---|
rw.SVu(v) |
Symbol + Value + Unit | σ = 12.5 MPa |
rw.SEVu(v) |
Substituted Equation + Value + Unit | σ = F/A = 32000/0.003 = 10.7 MPa |
rw.SD(v) |
Symbolic Definition only | σ = F/A |
rw.M(latex) |
Arbitrary LaTeX math block | $ \frac{x+1}{\Theta} $ |
rw.Eu(v) |
Evaluated value + Unit | = 10.7 MPa |
rw.D(v) |
Short display (value only) | 10.7 |
Combination example
# from new-DocumentStep02/TimberTest01.fcs
FCS.Reporting.Paragraph{
TextFn := rw =>
"The tensile stress is\n" +
rw.SD(Check.sigma_t_0_d) +
rw.M("\\left[ z \\left(1 + \\sqrt{\\omega} \\right) = 1 \\right]") +
rw.Eu(Check.sigma_t_0_d) + "\n" +
rw.SEVu(Check.sigma_t_0_d) + "\n"
}
1.6 Complete Chapter Example
# from new-DocumentStep02/TimberTest01.fcs
chapter1 := FCS.Reporting.Chapter{
Title = "Geometry",
Children = [
FCS.Reporting.Paragraph{
TextFn := rw =>
"Cross-section dimensions:\n" +
rw.SVu(Section.beamWidth) + "\n" +
rw.SVu(Section.beamHeight) + "\n"
},
FCS.Reporting.Paragraph{
TextFn := rw =>
"Cross-sectional area:\n" +
rw.SD(Beam.netArea) + "\n" +
rw.SEVu(Beam.netArea) + "\n"
}
]
}
chapter2 := FCS.Reporting.Chapter{
Title = "Stress check",
Children = [
FCS.Reporting.Paragraph(rw => "Axial force:"),
FCS.Reporting.Formula(rw => rw.SVu(Beam.force)),
FCS.Reporting.Paragraph(rw => "Tensile stress:"),
FCS.Reporting.Formula(rw => rw.SD(Check.sigma_t_0_d)),
FCS.Reporting.Formula(rw => rw.SEVu(Check.sigma_t_0_d))
]
}
Source file
TestData/new-DocumentStep02/TimberTest01.fcs
1.7 Fcs.Reporting.Document — Top-Level Container
A Document is the outermost wrapper for an HTML report. Unlike a Chapter, it
controls render settings (LaTeX, units, table-of-content) for all children.
reportDocument := Fcs.Reporting.Document{
DefaultSetup := Fcs.Reporting.Setup{
LatexSyntax = False,
Units = Fcs.Units.Setup(...),
Collapsible = True,
GenerateTableOfContent = True,
Numbered = True,
RepeatingIdsToReferences = False,
},
Collapsed := False,
Title := "My Report Title",
Children := [
chapter1,
table1,
image1,
nestedDocument,
],
}
Shorthand setup (HBC-2 pattern):
DefaultSetup := res.doc.DocSetup.Standard{
GenerateTableOfContent = False,
RepeatingIdsToReferences = False,
Numbered = False,
}
(res.doc = _Submodules/fcs-common/FcsDocument/FcsDocTools.fcs)
CLI to open a report in the browser:
browse_report reportDocument
1.8 Fcs.Reporting.Setup — Render Configuration
setup := Fcs.Reporting.Setup{
LatexSyntax = True, # render math as LaTeX
Units = Fcs.Units.Setup(...), # unit display settings
Collapsible = True, # collapsible sections
GenerateTableOfContent = True, # auto TOC
Numbered = True, # numbered headings
RepeatingIdsToReferences = False, # convert repeated IDs to refs
}
1.9 Fcs.Reporting.Table
# Header row
header := Fcs.Reporting.Table.Row([
Fcs.Reporting.Text("Column 1"),
Fcs.Reporting.Text("Column 2"),
Fcs.Reporting.Text("Column 3"),
])
# Body rows from data via .Select()
bodyRows := dataList.Select(item => Fcs.Reporting.Table.Row([
Fcs.Reporting.Text(item.Name),
Fcs.Reporting.Text(item.Value.ToString("0.00")),
Fcs.Reporting.Text(item.Unit),
]))
# Complete table
table := Fcs.Reporting.Table{
Header := header,
Body := bodyRows,
}
Literal rows:
table := Fcs.Reporting.Table{
Header := Fcs.Reporting.Table.Row([
Fcs.Reporting.Text("Load Case"),
Fcs.Reporting.Text("Fx [kN]"),
Fcs.Reporting.Text("Fz [kN]"),
]),
Body := [
Fcs.Reporting.Table.Row([
Fcs.Reporting.Text("Self Weight"),
Fcs.Reporting.Text("0.00"),
Fcs.Reporting.Text("-5.23"),
]),
Fcs.Reporting.Table.Row([
Fcs.Reporting.Text("Dead Load"),
Fcs.Reporting.Text("0.00"),
Fcs.Reporting.Text("-2.10"),
]),
],
}
1.10 Fcs.Reporting.Image
image := Fcs.Reporting.Image{
ImageContent := Fcs.Presentation.ImageRenderer{
Model = someGclass,
DrawSettingsFile = res.GetFileNamePath("DrawSettings.fcsdrs"),
ProjectionSettingsFile = res.GetFileNamePath("ReportModels.fcsdrv"),
AutoZoom = True,
ComputePolygonVisibility = True,
},
Title := "Figure caption",
HtmlStyle := "width:100%", # optional CSS
}
For full details on .fcsdrs / .fcsdrv JSON formats, see 24-IMAGE-RENDERING-AND-SETTINGS.md.
1.11 Complete Document Example (HBC-2 pattern)
reportDocument := Fcs.Reporting.Document{
DefaultSetup := res.doc.DocSetup.Standard{
GenerateTableOfContent = False,
RepeatingIdsToReferences = False,
Numbered = False,
},
Collapsed := False,
Children := [
# 1. Header
res.doc.ReportHeader{
reportTitle := "Primary structure report",
companyName, quoteNumber
}.contentHeader,
# 2. 3D overview image
overallImage, # Fcs.Reporting.Image
# 3. Bill of materials
primaryAllBomReport, # nested Fcs.Reporting.Document
# 4. Per-frame detail reports
primaryReportPerFrame, # nested Fcs.Reporting.Document
# 5. Notes chapter
notesChapter, # Fcs.Reporting.Chapter
# 6. CSS styling
res.doc.DocStylingText.StyleTextChapter
],
}
2. DXF Export
Geometry can be exported as a 2-D DXF drawing by running FLI with the dxf output flag:
fli run model.fcs --output dxf --file output.dxf
Inside the FCS file, geometry placed in a distribution or directly is exported layer-by-layer. Layer names in the FCS model become DXF layer names.
Example script (from new-dxf/dxf.fcs)
mrec := MoreRectangle{}
sec := SectionRectangle{}
gblock {gm1} gclass {mrec} lcs GCS
gblock {gm2} gclass {mrec} lcs (GCS.Ty(0.75))
distribution {gmd1} gclass {sec}
lcs GCS.Ty(-1)
transformation translation direction {1,0,0}
repetitions count (5) spacings (5*[0.75])
DXF output preserves:
- Curve geometry (lines, arcs, splines)
- Layer assignments and colors
- Block instances (gblock → INSERT entity)
Source folder
TestData/new-dxf/
3. Image Renderer (Fcs.Presentation.ImageRenderer)
Renders the 3-D model to a PNG image file. Used for automated snapshot tests and report illustrations.
Fcs.Presentation.ImageRenderer.RenderToFile(
"output.png",
{ Width:=800, Height:=600, Camera:=Fcs.Presentation.Camera.Top }
)
| Option | Description |
|---|---|
Width, Height |
Pixel dimensions |
Camera |
Top, Front, Side, Isometric |
BackgroundColor |
ARGB color |
AutoFit mode
Fcs.Presentation.ImageRenderer.RenderAutoFitToFile(
"output.png",
{ Width:=800, Height:=600 }
)
AutoFit adjusts the camera zoom to fit all visible geometry.
Source folders
TestData/new-TestImages/TestData/new-TestImageAutoFit/
4. .fcsdrs / .fcsdrv Display Settings Files
Display style resources are JSON-like files that control per-element appearance (color, transparency, layer visibility) at the gblock level:
gblock {gbPanel} gclass {gcPanel} lcs { ... } fcsdrs ("panelStyle.fcsdrs")
File extension conventions:
| Extension | Purpose |
|---|---|
.fcsdrs |
Display style (colors, visibility flags) |
.fcsdrv |
View preset (camera, section planes, active layers) |
Source folders
TestData/new-GBlockFcsdrs/TestData/new-LabelStyles/
5. Label Styles
Labels annotate geometry elements with text. Label style is defined in a .fcsdrs resource and applied to an element:
gblock {gbLabel} gclass {gcAnnotation} lcs { Origin=...} fcsdrs ("labelStyle.fcsdrs")
Source folder
TestData/new-LabelStyles/
6. Quick Reference
# --- Chapter/paragraph report ---
report := FCS.Reporting.Chapter{
Title = "My Check",
Children = [
FCS.Reporting.Paragraph(rw => "Force = " + rw.SVu(Beam.force)),
FCS.Reporting.Formula(rw => rw.SEVu(Beam.stress))
]
}
# --- rw methods ---
# rw.SVu(v) = symbol + value + unit
# rw.SEVu(v) = symbolic equation = substituted = value + unit
# rw.SD(v) = symbolic definition
# rw.M(latex) = raw LaTeX math
# rw.Eu(v) = evaluated + unit
# --- Image render ---
Fcs.Presentation.ImageRenderer.RenderToFile("out.png", { Width:=800, Height:=600 })
7. Relevant Test Folders
| Folder | Feature |
|---|---|
new-DocumentStep02/ |
Chapter/Paragraph/Formula full example |
new-TestImages/ |
ImageRenderer.RenderToFile |
new-TestImageAutoFit/ |
RenderAutoFitToFile |
new-dxf/ |
DXF export |
new-LabelStyles/ |
Label styles |
new-GBlockFcsdrs/ |
.fcsdrs display resources |
test-Outputs/ |
General output tests |