SectionApi
| Method | Description |
|---|---|
| Sections | Get sections |
| UpdateSection | Update a section in the RCS project |
Sections
List<RcsSection> Sections (Guid projectId)
Get sections
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.RcsApi.Api;
using IdeaStatiCa.RcsApi.Client;
using IdeaStatiCa.RcsApi.Model;
namespace Example
{
public class SectionsExample
{
public static void Main()
{
// Create the client which is connected to the service.
ConnectionApiClientFactory clientFactory = new ConnectionApiClientFactory("http://localhost:5000");
using (var conClient = await clientFactory.CreateConnectionApiClient())
{
try
{
// Get sections
List<RcsSection> result = conClient.Section.Sections(projectId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Section.Sections: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
}
}
}
}
}
Code Samples
It looks like the sample you are looking for does not exist.
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
GET /api/1/projects/{projectId}/sections
Using the SectionsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get sections
ApiResponse<List<RcsSection>> response = conClient.Section.SectionsWithHttpInfo(projectId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SectionApi.SectionsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateSection
RcsSection UpdateSection (Guid projectId, RcsSection rcsSection = null)
Update a section in the RCS project
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | Id of the project in cache | |
| rcsSection | RcsSection | A new reinforced section data. The value defines the section in project to update | [optional] |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.RcsApi.Api;
using IdeaStatiCa.RcsApi.Client;
using IdeaStatiCa.RcsApi.Model;
namespace Example
{
public class UpdateSectionExample
{
public static void Main()
{
// Create the client which is connected to the service.
ConnectionApiClientFactory clientFactory = new ConnectionApiClientFactory("http://localhost:5000");
using (var conClient = await clientFactory.CreateConnectionApiClient())
{
var rcsSection = new RcsSection(); // RcsSection | A new reinforced section data. The value defines the section in project to update (optional)
try
{
// Update a section in the RCS project
RcsSection result = conClient.Section.UpdateSection(projectId, rcsSection);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Section.UpdateSection: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.RCS.Model;
using IdeaStatiCa.RcsApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Calculates all avaliable sections in an existing RCS project.
/// </summary>
/// <param name="rcsClient">The connected RCS API Client</param>
public static async Task UpdateSection(IRcsApiClient rcsClient)
{
string filePath = "Inputs/Project3.IdeaRcs";
RcsProject rcsProject = await rcsClient.Project.OpenProjectAsync(filePath);
//Get the list of avaliable reinforced cross-sections in the project
List<RcsReinforcedCrossSection> reinforcedCrossSections = await rcsClient.CrossSection.ReinforcedCrossSectionsAsync(rcsClient.Project.ProjectId);
//Print avaliable Reinforced Cross Sections in the project
Console.WriteLine("Avaliable Reinforced Cross-sections");
foreach (var css in reinforcedCrossSections)
{
Console.WriteLine($"Id={css.Id} Name={css.Name}");
}
//Get the list of avaliable sections in the project
List<RcsSection> sections = await rcsClient.Section.SectionsAsync(rcsClient.Project.ProjectId);
//Print avaliable Reinforced Cross Sections in the project
Console.WriteLine("Avaliable Sections");
foreach (var section in sections)
{
Console.WriteLine($"Id={section.Id} Name={section.Description}");
}
// Prompt until a valid section is selected
RcsSection sectionToUpdate = null;
while (sectionToUpdate == null)
{
Console.Write("\nEnter the name of the section to update: ");
string sectionName = Console.ReadLine();
sectionToUpdate = sections.FirstOrDefault(x => x.Description.Equals(sectionName, StringComparison.OrdinalIgnoreCase));
if (sectionToUpdate == null)
{
Console.WriteLine("Invalid section name. Please try again.");
}
}
// Prompt until a valid reinforced cross-section is selected
RcsReinforcedCrossSection newReinforcedCrossSection = null;
while (newReinforcedCrossSection == null)
{
Console.Write("\nEnter the name of the reinforced cross-section to apply: ");
string rcsName = Console.ReadLine();
newReinforcedCrossSection = reinforcedCrossSections
.FirstOrDefault(x => x.Name.Equals(rcsName, StringComparison.OrdinalIgnoreCase));
if (newReinforcedCrossSection == null)
{
Console.WriteLine("Invalid reinforced cross-section name. Please try again.");
}
}
//Find the reinforced cross-section which we want to set to the section.
sectionToUpdate.RCSId = newReinforcedCrossSection.Id;
//Section is updated and returned
RcsSection updatedSection = await rcsClient.Section.UpdateSectionAsync(rcsClient.Project.ProjectId, sectionToUpdate);
//Get a folder on Desktop for the Example
string exampleFolder = GetExampleFolderPathOnDesktop("Update Section");
// Save updated file.
string fileName = "Project3_SectionUpdated.ideaRcs";
string saveFilePath = Path.Combine(exampleFolder, fileName);
await rcsClient.Project.SaveProjectAsync(rcsClient.Project.ProjectId, saveFilePath);
Console.WriteLine("File saved to: " + saveFilePath);
//close the project
await rcsClient.Project.CloseProjectAsync(rcsClient.Project.ProjectId);
}
}
}
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
PUT /api/1/projects/{projectId}/sections
Using the UpdateSectionWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Update a section in the RCS project
ApiResponse<RcsSection> response = conClient.Section.UpdateSectionWithHttpInfo(projectId, rcsSection);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SectionApi.UpdateSectionWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Authorization
No authorization required
HTTP request headers
- Content-Type: application/xml, text/xml, application/+xml, application/json-patch+json, application/json, text/json, application/+json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]