Pulling Data

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

ParameterTypeDescription
beamProjectstringProject identifier (optional)

Returns

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

Project Identifier

ValueBehavior
"" or omittedUses 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

SectionContents
ConcreteExtentsSection geometry (T-Beam, I-Beam, etc.)
DesignCriteria.ProjectInformationProject name, designer, dates
DesignCriteria.MaterialPropertiesConcrete, steel properties
DesignCriteria.LoadCombinationsLoad combination definitions
DesignCriteria.SettingsVarious analysis settings
StructuralModel.LoadingApplied loads
StructuralModel.BearingSupport conditions
StructuralModel.DappedEndsDapped end configurations
StructuralModel.ShoringTemporary supports
Reinforcement.PrestressStrand groups, patterns
Reinforcement.RebarLongitudinal reinforcement
Reinforcement.TransverseReinforcementShear reinforcement
Reinforcement.WeldedWireReinforcementMesh 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

ResponseCodeMeaning
LicenseErrorInvalid or expired license key
InvalidRequestProject not found or invalid identifier
InternalServerErrorUnexpected 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

>