Data Model Overview

Data Model Overview

The BeamDesign class is the root object for all beam design data. It contains every input field accessible through the Eriksson Beam API.

BeamDesign Structure

public class BeamDesign
{
    public string FileVersion { get; set; }
    public ConcreteExtents ConcreteExtents { get; set; }
    public DesignCriteria DesignCriteria { get; set; }
    public StructuralModel StructuralModel { get; set; }
    public Reinforcement Reinforcement { get; set; }
}

Main Sections

PropertyDescriptionDocumentation
ConcreteExtentsSection geometry (T-Beam, I-Beam, etc.)ConcreteExtents
DesignCriteriaProject info, materials, load combinations, settingsDesignCriteria
StructuralModelLoading, bearing, dapped ends, shoringStructuralModel
ReinforcementPrestress, rebar, transverse, welded wireReinforcement

Accessing Data

var design = await client.PullBeamDesignerAsync();

// Access project information
string projectName = design.DesignCriteria.ProjectInformation.ProjectName;
string designer = design.DesignCriteria.ProjectInformation.DesignerName;

// Access section properties (cast to specific type)
if (design.ConcreteExtents is TBeam tBeam)
{
    double length = tBeam.Length;
    double height = tBeam.Height;
}

// Access loading
double selfWeightMult = design.StructuralModel.Loading.SelfWeightMultiplier;

// Access reinforcement
var strandGroups = design.Reinforcement.Prestress.StrandGroups;

Modifying Data

// Pull first to get current values
var design = await client.PullBeamDesignerAsync();

// Modify properties
design.DesignCriteria.ProjectInformation.DesignerName = "Jane Doe";
design.DesignCriteria.ProjectInformation.Date = DateTime.Now;
design.StructuralModel.Loading.SelfWeightMultiplier = 1.2;

// Push changes back
await client.PushBeamDesignerAsync("", design);

Important Notes

Polymorphic ConcreteExtents

ConcreteExtents is a base class with multiple derived types. Use pattern matching:

switch (design.ConcreteExtents)
{
    case TBeam tBeam:
        // Handle T-Beam
        break;
    case IBeam iBeam:
        // Handle I-Beam
        break;
    case Rectangular rect:
        // Handle rectangular section
        break;
    // ... other types
}

Nullable Properties

Some properties may be null. Always check before accessing:

if (design.ConcreteExtents != null)
{
    // Safe to access
}

Units

The API uses inches for length and pounds for force, unless otherwise documented. Verify units for specific properties.

Never Create BeamDesign Directly

Always pull from Eriksson Beam to preserve existing data:

// CORRECT
var design = await client.PullBeamDesignerAsync();

// WRONG - causes data loss
var design = new BeamDesign();  // All defaults!

Complete Example

using System;
using System.Threading.Tasks;
using ErikssonBeam.API.BeamClient;
using ErikssonBeam.API.BeamDesigner;

class DataModelExample
{
    static async Task ExploreDesign(ErikssonBeamClient client)
    {
        var design = await client.PullBeamDesignerAsync();

        // Project Information
        var info = design.DesignCriteria.ProjectInformation;
        Console.WriteLine($"Project: {info.ProjectName}");
        Console.WriteLine($"Client: {info.ClientName}");
        Console.WriteLine($"Designer: {info.DesignerName}");

        // Section Type
        Console.WriteLine($"\nSection Type: {design.ConcreteExtents?.GetType().Name ?? "None"}");

        switch (design.ConcreteExtents)
        {
            case TBeam t:
                Console.WriteLine($"  Length: {t.Length}\"");
                Console.WriteLine($"  Width: {t.Width}\"");
                Console.WriteLine($"  Height: {t.Height}\"");
                break;
            case IBeam i:
                Console.WriteLine($"  Length: {i.Length}\"");
                Console.WriteLine($"  Height: {i.Height}\"");
                break;
        }

        // Loading
        var loading = design.StructuralModel.Loading;
        Console.WriteLine($"\nSelf-Weight Multiplier: {loading.SelfWeightMultiplier}");

        // Materials
        var materials = design.DesignCriteria.MaterialProperties;
        Console.WriteLine($"\nConcrete Properties configured: {materials != null}");

        // Reinforcement
        var prestress = design.Reinforcement.Prestress;
        var strandCount = prestress?.StrandGroups?.Count ?? 0;
        Console.WriteLine($"\nStrand Groups: {strandCount}");
    }
}

See Also