Data Operations
The Eriksson Beam API provides operations for exchanging data between your application and Eriksson Beam. This section covers the core operations for reading and writing beam design data.
Overview
| Operation | Method | Description |
|---|---|---|
| Pull | PullBeamDesignerAsync |
Retrieve data from Eriksson Beam |
| Push | PushBeamDesignerAsync |
Send modified data to Eriksson Beam |
| List Files | GetOpenBeamProjects |
Get list of open project files |
| Save | SaveProject |
Save a project to disk |
| Create | CreateProjects |
Create new blank project files |
The Pull-Modify-Push Pattern
The standard workflow for modifying beam designs:
// 1. Pull current state
var design = await client.PullBeamDesignerAsync("project");
// 2. Modify properties
design.DesignCriteria.ProjectInformation.DesignerName = "Jane Doe";
design.StructuralModel.Loading.SelfWeightMultiplier = 1.2;
// ... more modifications
// 3. Push changes back
await client.PushBeamDesignerAsync("project", design);
Critical Rules
Always Pull Before Modifying
Never create a BeamDesign directly. Always pull first to preserve existing data:
// CORRECT: Pull first
var design = await client.PullBeamDesignerAsync("project");
design.DesignCriteria.ProjectInformation.DesignerName = "Jane";
await client.PushBeamDesignerAsync("project", design);
// WRONG: Direct creation causes data loss!
var design = new BeamDesign(); // All fields are defaults!
design.DesignCriteria.ProjectInformation.DesignerName = "Jane";
await client.PushBeamDesignerAsync("project", design); // Overwrites EVERYTHING
Batch Changes Before Pushing
Pushes are expensive. Make all modifications first, then push once:
// CORRECT: Single push
design.DesignCriteria.ProjectInformation.DesignerName = "Jane";
design.DesignCriteria.ProjectInformation.ClientName = "ACME Corp";
design.StructuralModel.Loading.SelfWeightMultiplier = 1.2;
await client.PushBeamDesignerAsync("project", design); // One push
// WRONG: Multiple pushes
design.DesignCriteria.ProjectInformation.DesignerName = "Jane";
await client.PushBeamDesignerAsync("project", design); // Slow!
design.DesignCriteria.ProjectInformation.ClientName = "ACME Corp";
await client.PushBeamDesignerAsync("project", design); // Slower!
Project Identification
Methods accept a beamProject parameter that identifies which project to operate on:
| Value | Behavior |
|---|---|
"" (empty string) |
Use the single open project (fails if multiple open) |
"ProjectName" |
Match by file name without extension |
@"C:\path\file.ebf" |
Match by full file path |
// Single file open - no identifier needed
var design = await client.PullBeamDesignerAsync();
var design = await client.PullBeamDesignerAsync("");
// By name (without extension)
var design = await client.PullBeamDesignerAsync("MyProject");
// By full path
var design = await client.PullBeamDesignerAsync(@"C:\Projects\MyProject.ebf");
Error Handling
All data operations can throw these exceptions:
| Exception | Cause |
|---|---|
ObjectDisposedException |
Client has been disposed |
ServerErrorException |
Server rejected the operation |
ErikssonBeamNotRunningException |
Connection lost |
OperationCanceledException |
Timeout exceeded |
ArgumentNullException |
Null parameter provided |
try
{
var design = await client.PullBeamDesignerAsync("project");
// Modify...
await client.PushBeamDesignerAsync("project", design);
}
catch (ServerErrorException ex)
{
Console.WriteLine($"Server error: {ex.Response.ErrorMessage}");
// Check ex.Response.ResponseCode for specific error type
}
catch (ErikssonBeamNotRunningException)
{
Console.WriteLine("Lost connection to Eriksson Beam");
}
catch (OperationCanceledException)
{
Console.WriteLine("Operation timed out");
}
Units
Unless otherwise noted, the API uses inches and pounds for dimensional and force values respectively. Always verify units match your expectations when working with specific properties.
Next Steps
- Pulling Data - Retrieve beam designs
- Pushing Data - Update beam designs
- Project Management - File operations