Eriksson Beam API
Search Results for

    Show / Hide Table of Contents

    Pulling Data

    Retrieve beam design data from Eriksson Beam using PullBeamDesignerAsync.

    Basic Usage

    // Pull from single open project
    var design = await client.PullBeamDesignerAsync();
    
    // Pull from specific project by name
    var design = await client.PullBeamDesignerAsync("MyProject");
    
    // Pull from specific project by path
    var design = await client.PullBeamDesignerAsync(@"C:\Projects\MyProject.ebf");
    

    Method Signature

    public async Task<BeamDesign> PullBeamDesignerAsync(string beamProject = "")
    

    Parameters

    Parameter Type Description
    beamProject string Project identifier (optional)

    Returns

    A BeamDesign object containing all input data from the specified project.

    Project Identifier

    Value Behavior
    "" or omitted Uses single open project. Throws if multiple projects are open.
    "ProjectName" Matches by file name without extension
    @"C:\path\file.ebf" Matches by full file path

    What Gets Retrieved

    The BeamDesign object contains the complete input state:

    var design = await client.PullBeamDesignerAsync("project");
    
    // Access different sections
    var projectInfo = design.DesignCriteria.ProjectInformation;
    var materials = design.DesignCriteria.MaterialProperties;
    var loading = design.StructuralModel.Loading;
    var bearing = design.StructuralModel.Bearing;
    var prestress = design.Reinforcement.Prestress;
    var section = design.ConcreteExtents;  // May be TBeam, IBeam, etc.
    

    Data Sections

    Section Contents
    ConcreteExtents Section geometry (T-Beam, I-Beam, etc.)
    DesignCriteria.ProjectInformation Project name, designer, dates
    DesignCriteria.MaterialProperties Concrete, steel properties
    DesignCriteria.LoadCombinations Load combination definitions
    DesignCriteria.Settings Various analysis settings
    StructuralModel.Loading Applied loads
    StructuralModel.Bearing Support conditions
    StructuralModel.DappedEnds Dapped end configurations
    StructuralModel.Shoring Temporary supports
    Reinforcement.Prestress Strand groups, patterns
    Reinforcement.Rebar Longitudinal reinforcement
    Reinforcement.TransverseReinforcement Shear reinforcement
    Reinforcement.WeldedWireReinforcement Mesh reinforcement

    Multiple Projects

    When multiple projects are open, you must specify which one to pull:

    // Get list of open projects
    var openProjects = await client.GetOpenBeamProjects();
    // Returns: ["Project1", "Project2", "Project3"]
    
    // Pull specific project
    var design1 = await client.PullBeamDesignerAsync("Project1");
    var design2 = await client.PullBeamDesignerAsync("Project2");
    

    Error Handling

    try
    {
        var design = await client.PullBeamDesignerAsync("NonExistent");
    }
    catch (ServerErrorException ex)
    {
        // Project not found or other server error
        Console.WriteLine($"Error: {ex.Response.ErrorMessage}");
        Console.WriteLine($"Code: {ex.Response.ResponseCode}");
    }
    catch (ArgumentNullException)
    {
        // Null project parameter
    }
    catch (ErikssonBeamNotRunningException)
    {
        // Connection lost
    }
    catch (OperationCanceledException)
    {
        // Timeout exceeded
    }
    

    Common ServerErrorException Cases

    ResponseCode Meaning
    LicenseError Invalid or expired license key
    InvalidRequest Project not found or invalid identifier
    InternalServerError Unexpected server error

    Complete Example

    using System;
    using System.Threading.Tasks;
    using ErikssonBeam.API.BeamClient;
    using ErikssonBeam.API.BeamDesigner;
    
    class PullExample
    {
        static async Task DisplayProjectInfo(ErikssonBeamClient client, string projectName)
        {
            try
            {
                Console.WriteLine($"Pulling data from '{projectName}'...");
    
                var design = await client.PullBeamDesignerAsync(projectName);
    
                // Display project information
                var info = design.DesignCriteria.ProjectInformation;
                Console.WriteLine($"  Project: {info.ProjectName}");
                Console.WriteLine($"  Client: {info.ClientName}");
                Console.WriteLine($"  Designer: {info.DesignerName}");
                Console.WriteLine($"  Date: {info.Date:yyyy-MM-dd}");
    
                // Display section type
                switch (design.ConcreteExtents)
                {
                    case TBeam tBeam:
                        Console.WriteLine($"  Section: T-Beam ({tBeam.Length}\" long)");
                        break;
                    case IBeam iBeam:
                        Console.WriteLine($"  Section: I-Beam ({iBeam.Length}\" long)");
                        break;
                    case Rectangular rect:
                        Console.WriteLine($"  Section: Rectangular ({rect.Length}\" long)");
                        break;
                    default:
                        Console.WriteLine($"  Section: {design.ConcreteExtents?.GetType().Name ?? "None"}");
                        break;
                }
    
                // Display load count
                var loading = design.StructuralModel.Loading;
                Console.WriteLine($"  Self-Weight Multiplier: {loading.SelfWeightMultiplier}");
            }
            catch (ServerErrorException ex)
            {
                Console.WriteLine($"Failed to pull '{projectName}': {ex.Response.ErrorMessage}");
            }
        }
    
        static async Task Main()
        {
            var args = new ErikssonBeamConnectionAttemptArgs
            {
                LicenseKey = Environment.GetEnvironmentVariable("ERIKSSON_LICENSE_KEY")
            };
    
            var client = await ErikssonBeamFinder.GetFirstSupportedBeamClient(args);
    
            try
            {
                var projects = await client.GetOpenBeamProjects();
    
                foreach (var project in projects)
                {
                    await DisplayProjectInfo(client, project);
                    Console.WriteLine();
                }
            }
            finally
            {
                client.Dispose();
            }
        }
    }
    

    Performance Considerations

    • Pull operations retrieve the entire project state
    • Data is serialized as JSON over Named Pipes
    • Typical pull times: 100-500ms depending on project complexity
    • Consider caching if you need repeated access to the same data

    See Also

    • Pushing Data - Send modifications back
    • Data Model Overview - BeamDesign structure
    • Error Handling Guide - Exception details
    • Edit this page
    In this article
    Back to top Generated by DocFX