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

Create a shape builder section

A shape builder section is composed from up to 20 shapes — standard profiles drawn from dimensions (IShape, RectangularBar, Channel, …) or items pulled from a section library (Library). SPACE GASS computes the section properties (A, J, Iy, Iz) from the shapes; you never supply them.

This recipe builds a 360 UB 44.7 with a 250 × 16 cover plate welded to its top flange, then puts a member on it. Dimensions and translations are in the job's section-properties unit (mm by default — see GET /job/units).

1. Preview the base shape to find its reference points

Shapes are positioned relative to each other with an anchorPosition: "snap my point N onto your point M". The numbered reference points come from POST /sections/shape-builder/preview, which computes the geometry without writing anything. Point 1 is the centroid; 2–5 are the top, right, bottom and left mid-edges.

In both SDKs shapes is a plain list of shape objects, and each shape class sets its own shapeType.

using SpaceGassApi; using SpaceGassApi.Models; var client = SpaceGassApiClient.CreateClient("http://localhost:34560"); await client.Job.New.PostAsync(); var ub = new LibraryShape { Library = "Aust300", Name = "360 UB 44.7" }; var ubPreview = await client.Job.Structure.Sections.ShapeBuilder.Preview.PostAsync( new SectionShapeBuilderCreate { Name = "UB only", Shapes = [ub] }); // Top-centre of the UB: z == 0, highest y var ubTopCentre = ubPreview!.Shapes!.First().ReferencePoints! .Where(p => p.Z == 0) .OrderByDescending(p => p.Y) .First();

2. Define the plate and anchor it onto the UB

The plate's bottom-centre point (4) lands on the UB's top-centre point. anchorShape is the one-based position of the UB in the shapes list. anchorPosition is input-only: the API converts it to translateY / translateZ, which is what you read back.

var plate = new RectangularBarShape { D = 16.0, B = 250.0, Fabrication = ShapeFabrication.Heavily_Welded, AnchorPosition = new ShapeAnchorPosition { AnchorShape = 1, // the UB AnchorPoint = ubTopCentre.Point, // its top-centre point ShapePoint = 4, // the plate's bottom-centre point }, };

3. Create the section

Preview the full body first if you want to check the overall extent; then POST the same body to /sections/shape-builder. The response is a normal Section with the computed properties and shapeCount.

var request = new SectionShapeBuilderCreate { Name = "360 UB 44.7 + 250x16 plate", Mark = "B1", Shapes = [ub, plate], }; var preview = await client.Job.Structure.Sections.ShapeBuilder.Preview.PostAsync(request); Console.WriteLine($"Depth {preview!.Bounds!.MaxY - preview.Bounds.MinY}"); // 368 var section = await client.Job.Structure.Sections.ShapeBuilder.PostAsync(request); Console.WriteLine($"Section {section!.Id}: A={section.A}, Iz={section.Iz:E3}");

4. Apply it to a member

The section is referenced by Id like any other.

var member = await client.Job.Structure.Members.PostAsync( new MemberCreate { NodeA = node1.Id, NodeB = node2.Id, Section = section.Id, Material = steel.Id, });

5. Read the shapes back

GET /sections/{id} expands the shapes by default. A Library shape is resolved on create, so it comes back as the concrete profile (here an IShape) with the library item's name in shapeName. In the SDKs each shape comes back as its own class.

var saved = await client.Job.Structure.Sections[section.Id!.Value].GetAsync(); foreach (var shape in saved!.Shapes!) { Console.WriteLine($"{shape.Id}: {shape.ShapeType} {shape.ShapeName} " + $"translateY={shape.TranslateY}"); } // 1: IShape 360 UB 44.7 translateY=0 // 2: RectangularBar translateY=184

To replace an existing section's shapes in place (keeping its Id and modification factors), PUT the same body to /sections/{id}/shape-builder.

Run this example locally

The complete version — nodes, restraints, material, a comparison of the computed properties against the plain UB, and save — is in the repo as Example.BuiltUpSection (C#) and built_up_section (Python). Clone and run:

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

See also

  • Simple Beam Model — the beam this recipe's nodes, restraints and material come from.
  • API reference: POST /job/structure/sections/shape-builder, POST /job/structure/sections/shape-builder/preview, PUT /job/structure/sections/{id}/shape-builder, GET /job/query/geometry/sections/{id}.
Last modified on