ConnectionApi
| Method | Description |
|---|---|
| CopyConnectionAsync | Creates a copy of an existing connection in the project. |
| CreateEmptyConnectionAsync | Adds a new empty connection to the project. |
| DeleteConnectionAsync | Deletes a specific connection from the project. |
| GetConnectionAsync | Gets data about a specific connection in the project. |
| GetConnectionTopologyAsync | Gets the topology of the connection in JSON format. |
| GetConnectionsAsync | Gets data about all connections in the project. |
| GetProductionCostAsync | Gets the production cost of the connection. |
| UpdateConnectionAsync | Updates data of a specific connection in the project. |
CopyConnectionAsync
ConConnection CopyConnectionAsync (Guid projectId, int connectionId, string name = null)
Creates a copy of an existing connection in the project.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. | |
| connectionId | int | The ID of the source connection to copy. | |
| name | string | Optional name for the new connection. If null or empty, a unique name is derived from the source connection name. | [optional] |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class CopyConnectionAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
connectionId = 56; // int | The ID of the source connection to copy.
name = "name_example"; // string | Optional name for the new connection. If null or empty, a unique name is derived from the source connection name. (optional)
try
{
// Creates a copy of an existing connection in the project.
ConConnection result = await conClient.Connection.CopyConnectionAsync(projectId, connectionId, name);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.CopyConnectionAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.Connection.Model;
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Creates a copy of an existing connection in the project.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task CopyConnection(IConnectionApiClient conClient)
{
string filePath = "Inputs/simple knee connection.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
int connectionId = connections[0].Id;
//Copy the connection. If null or an empty string is passed instead of a name, a unique name is derived from the source connection name.
ConConnection newConnection = await conClient.Connection.CopyConnectionAsync(conClient.ActiveProjectId, connectionId, "Copy of " + connections[0].Name);
Console.WriteLine($"Connection '{newConnection.Name}' was created with Id {newConnection.Id}");
//List all connections in the project to see the new copy.
connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
Console.WriteLine($"The project now contains {connections.Count} connections:");
foreach (var connection in connections)
{
Console.WriteLine($"({connection.Id}) {connection.Name}");
}
string exampleFolder = GetExampleFolderPathOnDesktop("CopyConnection");
string saveFilePath = Path.Combine(exampleFolder, "knee connection - copied.ideaCon");
await conClient.Project.SaveProjectAsync(conClient.ActiveProjectId, saveFilePath);
Console.WriteLine("Project saved to: " + saveFilePath);
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
POST /api/5/projects/{projectId}/connections/{connectionId}/copy
Using the CopyConnectionWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Creates a copy of an existing connection in the project.
ApiResponse<ConConnection> response = conClient.Connection.CopyConnectionWithHttpInfo(projectId, connectionId, name);
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 ConnectionApi.CopyConnectionWithHttpInfo: " + 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 | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 422 | Unprocessable Content | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateEmptyConnectionAsync
ConConnection CreateEmptyConnectionAsync (Guid projectId, string name = null)
Adds a new empty connection to the project.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. | |
| name | string | Optional connection name. If null or empty, a default name `CON{newId}` is assigned. | [optional] |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class CreateEmptyConnectionAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
name = "name_example"; // string | Optional connection name. If null or empty, a default name `CON{newId}` is assigned. (optional)
try
{
// Adds a new empty connection to the project.
ConConnection result = await conClient.Connection.CreateEmptyConnectionAsync(projectId, name);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.CreateEmptyConnectionAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.Connection.Model;
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Adds a new empty connection to an opened project.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task CreateEmptyConnection(IConnectionApiClient conClient)
{
string filePath = "Inputs/simple knee connection.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
Console.WriteLine($"The project contains {connections.Count} connection(s)");
//Create a new empty connection. If null or an empty string is passed instead of a name, a default name 'CON{newId}' is assigned.
ConConnection emptyConnection = await conClient.Connection.CreateEmptyConnectionAsync(conClient.ActiveProjectId, "New empty connection");
Console.WriteLine($"Connection '{emptyConnection.Name}' was created with Id {emptyConnection.Id}");
//The empty connection has no members or operations yet. It can be populated using the Member, Operation and Template APIs.
List<ConMember> members = await conClient.Member.GetMembersAsync(conClient.ActiveProjectId, emptyConnection.Id);
Console.WriteLine($"The new connection contains {members.Count} members");
string exampleFolder = GetExampleFolderPathOnDesktop("CreateEmptyConnection");
string saveFilePath = Path.Combine(exampleFolder, "knee connection - empty connection added.ideaCon");
await conClient.Project.SaveProjectAsync(conClient.ActiveProjectId, saveFilePath);
Console.WriteLine("Project saved to: " + saveFilePath);
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
POST /api/5/projects/{projectId}/connections
Using the CreateEmptyConnectionWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Adds a new empty connection to the project.
ApiResponse<ConConnection> response = conClient.Connection.CreateEmptyConnectionWithHttpInfo(projectId, name);
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 ConnectionApi.CreateEmptyConnectionWithHttpInfo: " + 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 | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 422 | Unprocessable Content | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteConnectionAsync
List<ConConnection> DeleteConnectionAsync (Guid projectId, int connectionId)
Deletes a specific connection from the project.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. | |
| connectionId | int | The ID of the connection to delete. |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class DeleteConnectionAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
connectionId = 56; // int | The ID of the connection to delete.
try
{
// Deletes a specific connection from the project.
List<ConConnection> result = await conClient.Connection.DeleteConnectionAsync(projectId, connectionId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.DeleteConnectionAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.Connection.Model;
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Deletes a specific connection from the project.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task DeleteConnection(IConnectionApiClient conClient)
{
string filePath = "Inputs/simple knee connection.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
Console.WriteLine($"The project contains {connections.Count} connection(s)");
//Create a copy of the first connection so there is a second connection which can be safely deleted.
ConConnection copiedConnection = await conClient.Connection.CopyConnectionAsync(conClient.ActiveProjectId, connections[0].Id, "To be deleted");
Console.WriteLine($"Connection '{copiedConnection.Name}' was created with Id {copiedConnection.Id}");
//Delete the copied connection. The list of the remaining connections is returned.
List<ConConnection> remainingConnections = await conClient.Connection.DeleteConnectionAsync(conClient.ActiveProjectId, copiedConnection.Id);
Console.WriteLine($"Connection {copiedConnection.Id} was deleted. Remaining connections:");
foreach (var connection in remainingConnections)
{
Console.WriteLine($"({connection.Id}) {connection.Name}");
}
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
DELETE /api/5/projects/{projectId}/connections/{connectionId}
Using the DeleteConnectionWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Deletes a specific connection from the project.
ApiResponse<List<ConConnection>> response = conClient.Connection.DeleteConnectionWithHttpInfo(projectId, connectionId);
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 ConnectionApi.DeleteConnectionWithHttpInfo: " + 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 | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetConnectionAsync
ConConnection GetConnectionAsync (Guid projectId, int connectionId)
Gets data about a specific connection in the project.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. | |
| connectionId | int | The ID of the requested connection. |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class GetConnectionAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
connectionId = 56; // int | The ID of the requested connection.
try
{
// Gets data about a specific connection in the project.
ConConnection result = await conClient.Connection.GetConnectionAsync(projectId, connectionId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.GetConnectionAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.Connection.Model;
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Gets data about a specific connection in the project.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task GetConnection(IConnectionApiClient conClient)
{
string filePath = "Inputs/simple cleat connection.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
int connectionId = connections[0].Id;
//Get the data of one specific connection by its Id.
ConConnection connection = await conClient.Connection.GetConnectionAsync(conClient.ActiveProjectId, connectionId);
Console.WriteLine($"Id: {connection.Id}");
Console.WriteLine($"Name: {connection.Name}");
Console.WriteLine($"Identifier: {connection.Identifier}");
Console.WriteLine($"Description: {connection.Description}");
Console.WriteLine($"Analysis type: {connection.AnalysisType}");
Console.WriteLine($"Include buckling: {connection.IncludeBuckling}");
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
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/5/projects/{projectId}/connections/{connectionId}
Using the GetConnectionWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Gets data about a specific connection in the project.
ApiResponse<ConConnection> response = conClient.Connection.GetConnectionWithHttpInfo(projectId, connectionId);
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 ConnectionApi.GetConnectionWithHttpInfo: " + 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 | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetConnectionTopologyAsync
string GetConnectionTopologyAsync (Guid projectId, int connectionId)
Gets the topology of the connection in JSON format.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. | |
| connectionId | int | The ID of the connection for which to retrieve the topology. |
Return type
string
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class GetConnectionTopologyAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
connectionId = 56; // int | The ID of the connection for which to retrieve the topology.
try
{
// Gets the topology of the connection in JSON format.
string result = await conClient.Connection.GetConnectionTopologyAsync(projectId, connectionId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.GetConnectionTopologyAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Gets the topology of a connection in JSON format.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task GetConnectionTopology(IConnectionApiClient conClient)
{
string filePath = "Inputs/HSS_norm_cond.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
int connectionId = connections[0].Id;
//Get the topology of the connection as a JSON string.
//It describes how the members of the connection are arranged (e.g. for searching similar designs).
string topology = await conClient.Connection.GetConnectionTopologyAsync(conClient.ActiveProjectId, connectionId);
Console.WriteLine($"Topology of connection '{connections[0].Name}' ({connectionId}):");
Console.WriteLine(topology);
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
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/5/projects/{projectId}/connections/{connectionId}/get-topology
Using the GetConnectionTopologyWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Gets the topology of the connection in JSON format.
ApiResponse<string> response = conClient.Connection.GetConnectionTopologyWithHttpInfo(projectId, connectionId);
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 ConnectionApi.GetConnectionTopologyWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: text/plain
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetConnectionsAsync
List<ConConnection> GetConnectionsAsync (Guid projectId)
Gets data about all connections in the project.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class GetConnectionsAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
try
{
// Gets data about all connections in the project.
List<ConConnection> result = await conClient.Connection.GetConnectionsAsync(projectId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.GetConnectionsAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.Connection.Model;
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Gets data about all connections in the project.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task GetConnections(IConnectionApiClient conClient)
{
string filePath = "Inputs/simple cleat connection.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
//Get the list of all connections in the opened project.
List<ConConnection> connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
Console.WriteLine($"The project contains {connections.Count} connection(s):");
foreach (var connection in connections)
{
Console.WriteLine($"({connection.Id}) {connection.Name} - analysis type: {connection.AnalysisType}");
}
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
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/5/projects/{projectId}/connections
Using the GetConnectionsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Gets data about all connections in the project.
ApiResponse<List<ConConnection>> response = conClient.Connection.GetConnectionsWithHttpInfo(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 ConnectionApi.GetConnectionsWithHttpInfo: " + 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 | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetProductionCostAsync
ConProductionCost GetProductionCostAsync (Guid projectId, int connectionId)
Gets the production cost of the connection.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. | |
| connectionId | int | The ID of the requested connection. |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class GetProductionCostAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
connectionId = 56; // int | The ID of the requested connection.
try
{
// Gets the production cost of the connection.
ConProductionCost result = await conClient.Connection.GetProductionCostAsync(projectId, connectionId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.GetProductionCostAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.Connection.Model;
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Gets the estimated production cost of a connection.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task GetProductionCost(IConnectionApiClient conClient)
{
string filePath = "Inputs/simple cleat connection.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
int connectionId = connections[0].Id;
//Get the production cost estimate of the connection.
//The cost is based on the cost estimation settings of the project (steel, bolts, welds, hole drilling).
ConProductionCost productionCost = await conClient.Connection.GetProductionCostAsync(conClient.ActiveProjectId, connectionId);
Console.WriteLine($"Total estimated production cost of connection '{connections[0].Name}': {productionCost.TotalEstimatedCost:F2}");
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
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/5/projects/{projectId}/connections/{connectionId}/production-cost
Using the GetProductionCostWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Gets the production cost of the connection.
ApiResponse<ConProductionCost> response = conClient.Connection.GetProductionCostWithHttpInfo(projectId, connectionId);
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 ConnectionApi.GetProductionCostWithHttpInfo: " + 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 | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateConnectionAsync
ConConnection UpdateConnectionAsync (Guid projectId, int connectionId, ConConnection conConnection = null)
Updates data of a specific connection in the project.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | The unique identifier of the opened project in the ConnectionRestApi service. | |
| connectionId | int | The ID of the connection to be updated. | |
| conConnection | ConConnection | New connection data to be applied. | [optional] |
Return type
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.ConnectionApi.Api;
using IdeaStatiCa.ConnectionApi.Client;
using IdeaStatiCa.ConnectionApi.Model;
namespace Example
{
public class UpdateConnectionAsyncExample
{
public static async Task Main()
{
string ideaConFile = "testCon.ideaCon";
string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 26.0"; // Path to the IdeaStatiCa.ConnectionRestApi.exe
using (var clientFactory = new ConnectionApiServiceRunner(ideaStatiCaPath))
{
using (var conClient = await clientFactory.CreateApiClient())
{
// Open the project and get its id
var projData = await conClient.Project.OpenProjectAsync(ideaConFile);
Guid projectId = projData.ProjectId;
// (Required) Select parameters
connectionId = 56; // int | The ID of the connection to be updated.
var conConnection = new ConConnection(); // ConConnection | New connection data to be applied. (optional)
try
{
// Updates data of a specific connection in the project.
ConConnection result = await conClient.Connection.UpdateConnectionAsync(projectId, connectionId, conConnection);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Connection.UpdateConnectionAsync: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
await conClient.Project.CloseProjectAsync(projectId);
}
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.Connection.Model;
using IdeaStatiCa.ConnectionApi;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Updates the data of a specific connection in the project.
/// </summary>
/// <param name="conClient">The connected API Client</param>
public static async Task UpdateConnection(IConnectionApiClient conClient)
{
string filePath = "Inputs/simple cleat connection.ideaCon";
await conClient.Project.OpenProjectAsync(filePath);
var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
ConConnection connection = connections[0];
Console.WriteLine($"Current name: '{connection.Name}', description: '{connection.Description}'");
//Modify the connection data.
connection.Name = "Renamed connection";
connection.Description = "Description updated through the Connection API";
//Apply the new data to the connection.
ConConnection updatedConnection = await conClient.Connection.UpdateConnectionAsync(conClient.ActiveProjectId, connection.Id, connection);
Console.WriteLine($"Updated name: '{updatedConnection.Name}', description: '{updatedConnection.Description}'");
string exampleFolder = GetExampleFolderPathOnDesktop("UpdateConnection");
string saveFilePath = Path.Combine(exampleFolder, "simple cleat - connection update.ideaCon");
await conClient.Project.SaveProjectAsync(conClient.ActiveProjectId, saveFilePath);
Console.WriteLine("Project saved to: " + saveFilePath);
//Close the opened project.
await conClient.Project.CloseProjectAsync(conClient.ActiveProjectId);
}
}
}
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/5/projects/{projectId}/connections/{connectionId}
Using the UpdateConnectionWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Updates data of a specific connection in the project.
ApiResponse<ConConnection> response = conClient.Connection.UpdateConnectionWithHttpInfo(projectId, connectionId, conConnection);
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 ConnectionApi.UpdateConnectionWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 401 | Unauthorized | - |
| 404 | Not Found | - |
| 422 | Unprocessable Content | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]