🤖 New in SPACE GASS 14.51 — the MCP server lets your AI agent build, analyse and design your models. Get started →
SpaceGass API
Recipes

Design steel members

A design run selects a new section for each design group from a section library, puts it on the members, re-runs the analysis and repeats until the sections stop changing. To verify the existing sections without changing them, see Run a steel member design check.

Before you start

  • The model has static analysis results for the load cases you want to design for.
  • Your seat is licensed for the design code.
  • The snippets continue from the Simple Beam tutorial after its analysis step: client is the connected client, member is the beam, section is its 360 UB 44.7 and ulsCase is the ULS combination.

1. Set the library the design selects from

A design run picks sections from the default section library, not from the library the member's current section came from. Set it so the result does not depend on the machine's preferences.

The default libraries are a SPACE GASS preference: they are saved for every job, not just this one. Keep the previous value so you can put it back in step 7.

const string sectionLibrary = "Aust300"; var defaults = await client.Job.Settings.DefaultLibraries.GetAsync(); var previousLibrary = defaults!.Sections; await client.Job.Settings.DefaultLibraries.PatchAsync( new DefaultLibrariesUpdate { Sections = sectionLibrary });

2. Find the scan code

A library is divided into groups (universal beams, universal columns, channels, …) and each group has a scan code letter. A design group lists the scan codes it may select from, so this is how you keep a beam a universal beam.

Find the group the current section is in, then take that group's scan code.

var library = await client.Libraries.Sections[sectionLibrary].GetAsync(); foreach (var g in library!.Groups!) Console.WriteLine($"{g.ScanCode} {g.Name}"); // A Universal beams // C Universal columns // ... var match = await client.Libraries.Sections.Search.GetAsync(config => { config.QueryParameters.Q = section.Name; config.QueryParameters.Library = sectionLibrary; config.QueryParameters.Limit = 1; }); var sectionGroup = match!.Items!.First().Group; var scanCode = library.Groups.First(g => g.Name == sectionGroup).ScanCode; // "A"

3. Create a design group

Same as for a check, plus two inputs that steer the selection: scanCode (which library groups to choose from) and designCriteria (Weight for the lightest section, Depth for the shallowest).

var group = await client.Job.Design.SteelMembers.PostAsync( new SteelMemberCreate { Members = $"{member.Id}", MemberType = SteelMemberType.Beam, LoadHeightPosition = LoadHeightPosition.Top, LengthUnitBasis = LengthUnitBasis.Actual, CalculateLcMajorFromBuckling = false, LcMajor = 6.0, CalculateLcMinorFromBuckling = false, LcMinor = 6.0, CalculateLbFromFlangeRestraints = true, ScanCode = scanCode, DesignCriteria = SteelDesignCriteria.Weight, });

4. Choose what to design and how to iterate

The general settings say which design groups and load cases the run covers. The iteration settings say what happens after sections are selected: re-run the static analysis with the new sections, design again, and repeat until the result settles.

sections in the general settings is a filter, like groups: it limits the run to members on those section numbers. It is not a list of sections to choose from.

await client.Job.Design.SteelMember.Settings.PatchAsync( new SteelMemberDesignGeneralSettingsUpdate { Groups = $"{group!.Id}", LoadCases = $"{ulsCase.Id}", }); await client.Job.Design.SteelMember.DesignIterationSettings.PatchAsync( new SteelMemberDesignIterationSettingsUpdate { RerunStaticAnalysis = true, RerunDesign = true, AutoIterate = true, MaxIterations = 5, });

5. Run the design

Start the run, then poll GET /job/design/runs/{runId} until status is Completed, Failed or Cancelled. updateSections puts the selected sections on the members; set it to false to see what would be selected without changing the model.

var run = await client.Job.Design.SteelMember[DesignCode.As4100.ToString()].RunDesign.PostAsync( new SteelMemberDesignRunDesignRequest { UpdateSections = true }); DesignRun result; do { await Task.Delay(500); result = (await client.Job.Design.Runs[run!.RunId!.Value].GetAsync())!; } while (result.Status is not (RunStatus.Completed or RunStatus.Failed or RunStatus.Cancelled)); if (result.Status != RunStatus.Completed) throw new Exception($"Design run did not complete: {result.ErrorMessage}");

6. See what changed

The finished run reports what it did. Read the member again to get its new section, and the check summary for the result on that section.

Console.WriteLine($"Iterations {result.Iterations}, sections updated: {result.SectionsUpdated}, " + $"analysis re-run: {result.AnalysisRerun}"); var designed = await client.Job.Structure.Members[member.Id!.Value].GetAsync(); var newSection = await client.Job.Structure.Sections[designed!.Section!.Value].GetAsync(); Console.WriteLine($"{section.Name} -> {newSection!.Name}"); var summary = await client.Job.Query.Design.SteelMember.CheckSummary.GetAsync( config => config.QueryParameters.SteelMembers = $"{group.Id}"); foreach (var row in summary!.Results!) Console.WriteLine($"Group {row.SteelMember}: {row.Section}, load factor {row.LoadFactor:F3}, {row.Status}"); // Iterations 1, sections updated: True, analysis re-run: True // 360 UB 44.7 -> 200 UB 29.8 // Group 1: 200 UB 29.8, load factor 1.260, PassedWithWarnings

The run replaces the section's analysis results too: after it finishes, reactions, forces and deflections are for the new section.

7. Put the default library back

Do this before closing the job. In a real program, put it in a finally block so it also runs when a step fails.

await client.Job.Settings.DefaultLibraries.PatchAsync( new DefaultLibrariesUpdate { Sections = previousLibrary });

Run this example locally

A complete version that also builds and analyses the beam, starting from a deliberately heavy 610 UB 125, is in the repo as Example.SteelDesignOptimise (C#) and steel_design_optimise (Python). Clone and run:

git clone https://github.com/SpaceGass/space-gass-api.git cd space-gass-api/sdks/csharp/examples/Example.SteelDesignOptimise dotnet run

See also

Last modified on