FCS API Reference

Quick-reference for the most commonly needed built-in objects, functions, and namespaces that are not covered by the core language docs.


1. Fcm — Model Access

Fcm is the built-in gateway object for querying the FEM model after meshing.

Expression Returns
Fcm.GetAnalysis() Analysis result object (deformations, reactions, etc.)
Fcm.Mesh.Nodes Array of all mesh nodes
Fcm.Mesh.Elements Array of all elements
Fcm.ResourceReader.ReadJsonAsDynamicObjectArray("file.json") Parse a JSON file into a dynamic object array
Fcm.ResourceReader.ReadJsonAsDynamicObject("file.json") Parse a JSON file into a single dynamic object

Example: obtain mesh after analysis

model_shell3d
Mesh.AutoConnect = True
Mesh.ElementSize  = 0.2

analysis1 := Fcm.GetAnalysis()
# analysis1.Deformations, analysis1.ReactionForces, etc.

2. Fcs.Assembly — Structural Selectors

Used inside Mesh.ConnectRules and other places that expect a group of structural elements (see 15-MESH-CONNECTIVITY.md for full connectivity API).

Selector Description
Fcs.Assembly.AllBeams All beam elements
Fcs.Assembly.AllShells All shell elements
Fcs.Assembly.ShellsInLayer("name") Shells in the named mesh layer
Fcs.Assembly.BeamsInLayer("name") Beams in the named mesh layer

3. Fcs.Geometry.Vertex3D — Vertex Constructor

v := Fcs.Geometry.Vertex3D(x, y, z)    # returns a vertex object with .X .Y .Z

Used when building dynamic arrays of points (e.g. for filletedpoly items).


4. VariableSymbol — Annotated Engineering Quantity

(Full detail in 17-LOADS-ADVANCED.md.)

force := VariableSymbol{
    Definition   = 5000,
    Name         = "force",
    QuantityType = FCS.EngineeringQuantity.BeamInternalForce
}

FCS.EngineeringQuantity constants

Constant Physical quantity
BeamInternalForce Axial / shear force (N)
CrossSectionArea Area (m²)
BendingMoment Moment (N·m)
Stress Stress (Pa)
LoadForcePerArea Pressure (Pa)
Length Length (m)
Angle Angle (rad)

Division of VariableSymbols

# from new-VariableSymbols/test01.fcs
pressure := force / netArea    # creates a derived VariableSymbol

browse_report pressure         # prints symbol table with chain of substitutions

5. browse_report — Inline Symbol Dump

browse_report myVariable   # prints a table: Name | Symbol | Value | Unit | Reference

Any value (VariableSymbol or plain number) can be passed. For plain numbers the table is minimal. For VariableSymbol objects the full metadata chain is printed.


6. Fcs.Web.RestClient — HTTP Data Source

RestClient lets FCS scripts fetch external JSON data at evaluation time.

# from new-DataUrl/getprojectdata.fcs
client := Fcs.Web.RestClient{
    BaseAddress := "https://localhost:44309/api",
    Credentials := "user@example.com password123"
}

projectData := client.GetResponseObject("/data/current")
print projectData
Method Description
GetResponseObject(path) GET → single dynamic object
GetResponsesObjects(pathArray) GET multiple paths → array of objects

Security note: Never hard-code production credentials in FCS files committed to source control. Use environment variable injection or a secrets store.


7. Unit Constants

# convert degrees to radians (multiply)
angle_rad := 30 * Unit.deg         # = π/6

# length units
length_ft := 10 * Unit.ft          # = 3.048 m
length_mm := 250 * Unit.mm         # = 0.25 m

# inverse conversion
angle_deg_back := angle_rad / Unit.deg   # = 30
Constant Factor (SI)
Unit.mm 0.001 (m)
Unit.cm 0.01 (m)
Unit.ft 0.3048 (m)
Unit.deg π/180 (rad)
Unit.kN 1000 (N)
Unit.kPa 1000 (Pa)

8. Fcs.Geometry.Constrained.* — Geometric Constraints

These functions create constrained geometry (implicit dimensions, tangencies, etc.) when working in a constraint-based sketcher:

Fcs.Geometry.Constrained.Line(p1, p2)
Fcs.Geometry.Constrained.Arc(center, radius, startAngle, endAngle)
Fcs.Geometry.Constrained.Point(x, y)

Primarily used inside gclass files that contribute to the 2-D sketcher workflow.


9. Mesh.* — Mesh Control Settings

Setting Type Description
Mesh.ElementSize number (m) Target element edge length
Mesh.AutoConnect bool Auto-glue nodes of touching parts
Mesh.WeldNodes bool Merge duplicate nodes
Mesh.WeldNodesTolerance number (m) Weld radius
Mesh.DefaultElementType2D enum Fcs.Mesh.Element.Quadrilateral or Triangle
Mesh.ConnectRules Fcs.Mesh.ConnectRules{...} Explicit connectivity rules
OneMeshElementPerBeam bool Force exactly one element per beam

10. Model Activation Keywords

These single-word keywords switch the solver mode:

Keyword Solver activated
model_shell3d 3-D plate/shell + beam solver
model_plate2d 2-D in-plane plane-stress
model_beam2d 2-D beam frame
model_beam3d 3-D beam/frame (default when no shell members exist)
model_crosssection2d 2-D cross-section CSS analysis

11. gblock … fcsdrs(…) — Per-Instance Display Settings

gblock {gbPanel} gclass {gcPanel} lcs { ... } fcsdrs ("panelStyle.fcsdrs")

The .fcsdrs file path is relative to the current file. The resource file contains a JSON or FCS-value style map (colors, visibility).


12. Quick Reference

# Mesh + analysis
model_shell3d
Mesh.ElementSize  = 0.2
Mesh.AutoConnect  = True
analysis1 := Fcm.GetAnalysis()

# JSON resource
data := Fcm.ResourceReader.ReadJsonAsDynamicObjectArray("data.json")
item := data.FindOrDefault(d => d.Name == "key", {})

# REST client
client := Fcs.Web.RestClient{ BaseAddress:="https://myapi/api" }
obj    := client.GetResponseObject("/endpoint")

# VariableSymbol
v := VariableSymbol{ Definition=42, Name="v", QuantityType=FCS.EngineeringQuantity.Length }
browse_report v

# Unit conversion
angleDeg := 30
angleRad := angleDeg * Unit.deg

13. Relevant Test Folders

Folder API covered
new-DataUrl/ Fcs.Web.RestClient
new-VariableSymbols/ VariableSymbol, browse_report
new-SolverDemo/ Fcm.GetAnalysis, Mesh.AutoConnect
new-SlabOrthotropy/ Fcm.ResourceReader.ReadJsonAsDynamicObjectArray
new-GBlockFcsdrs/ gblock … fcsdrs(…)
new-HangingNodesRibAnd2Shells/ Fcs.Assembly.* selectors