Table of Contents

ParameterApi

Method Description
DeleteParametersAsync Delete all parameters and parameter model links for the connection connectionId in the project projectId.
EvaluateExpressionAsync Evaluate the expression and return the result. For more details see documentation about parameters: https://developer.ideastatica.com/docs/api/api_parameters_getting_started.html or https://developer.ideastatica.com/docs/api/api_parameter_reference_guide.html
GetParametersAsync Gets all parameters defined for the specified project and connection.
UpdateAsync Updates parameters for the specified connection in the project with the values provided.

DeleteParametersAsync

void DeleteParametersAsync (Guid projectId, int connectionId)

Delete all parameters and parameter model links for the connection connectionId in the project projectId.

Parameters

Name Type Description Notes
projectId Guid The unique identifier of the opened project in the ConnectionRestApi service.
connectionId int Id of the connection where to delete parameters.

Return type

void (empty response body)

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 DeleteParametersAsyncExample
    {
        public static async Task Main()
        {
            string ideaConFile = "testCon.ideaCon";
            
            string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 25.1"; // 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 | Id of the connection where to delete parameters.

                    try
                    {
                        // Delete all parameters and parameter model links for the connection connectionId in the project projectId.
                        conClient.Parameter.DeleteParametersAsync(projectId, connectionId);
                    }
                    catch (ApiException  e)
                    {
                        Console.WriteLine("Exception when calling Parameter.DeleteParametersAsync: " + 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>
        /// Delete all parameters and parameter model links of a connection.
        /// </summary>
        /// <param name="conClient">The connected API Client</param>
        public static async Task DeleteParameters(IConnectionApiClient conClient)
        {
            string filePath = "Inputs/User_testing_end_v23_1.ideaCon";
            await conClient.Project.OpenProjectAsync(filePath);

            var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
            int connectionId = connections[0].Id;

            // Get all parameters (including hidden ones) defined in the connection.
            List<IdeaParameter> parameters = await conClient.Parameter.GetParametersAsync(conClient.ActiveProjectId, connectionId, true);
            Console.WriteLine($"Parameters before delete: {parameters.Count}");

            // Delete all parameters and parameter model links for the connection.
            await conClient.Parameter.DeleteParametersAsync(conClient.ActiveProjectId, connectionId);
            Console.WriteLine("All parameters were deleted.");

            parameters = await conClient.Parameter.GetParametersAsync(conClient.ActiveProjectId, connectionId, true);
            Console.WriteLine($"Parameters after delete: {parameters.Count}");

            string exampleFolder = GetExampleFolderPathOnDesktop("DeleteParameters");

            // Save updated file.
            string fileName = "deleted-parameters.ideaCon";
            string saveFilePath = Path.Combine(exampleFolder, fileName);
            await conClient.Project.SaveProjectAsync(conClient.ActiveProjectId, saveFilePath);

            Console.WriteLine("File 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

DELETE /api/4/projects/{projectId}/connections/{connectionId}/parameters

Using the DeleteParametersWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete all parameters and parameter model links for the connection connectionId in the project projectId.
    conClient.Parameter.DeleteParametersWithHttpInfo(projectId, connectionId);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ParameterApi.DeleteParametersWithHttpInfo: " + 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
204 No Content -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

EvaluateExpressionAsync

string EvaluateExpressionAsync (Guid projectId, int connectionId, string body = null)

Evaluate the expression and return the result. For more details see documentation about parameters: https://developer.ideastatica.com/docs/api/api_parameters_getting_started.html or https://developer.ideastatica.com/docs/api/api_parameter_reference_guide.html

Parameters

Name Type Description Notes
projectId Guid The unique identifier of the opened project in the ConnectionRestApi service.
connectionId int Id of the connection to use for evaluation expression.
body string Expression to evaluate. See the API documentation for supported syntax and examples: https://developer.ideastatica.com/docs/api/api_parameters_getting_started.html [optional]

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 EvaluateExpressionAsyncExample
    {
        public static async Task Main()
        {
            string ideaConFile = "testCon.ideaCon";
            
            string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 25.1"; // 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 | Id of the connection to use for evaluation expression.
                    body = "body_example";  // string | Expression to evaluate. See the API documentation for supported syntax and examples: https://developer.ideastatica.com/docs/api/api_parameters_getting_started.html (optional) 

                    try
                    {
                        // Evaluate the expression and return the result.  For more details see documentation about parameters:  https://developer.ideastatica.com/docs/api/api_parameters_getting_started.html  or  https://developer.ideastatica.com/docs/api/api_parameter_reference_guide.html
                        string result = await conClient.Parameter.EvaluateExpressionAsync(projectId, connectionId, body);
                        Debug.WriteLine(result);
                    }
                    catch (ApiException  e)
                    {
                        Console.WriteLine("Exception when calling Parameter.EvaluateExpressionAsync: " + 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>
        /// Evaluate expressions in the context of a connection and its parameters.
        /// </summary>
        /// <param name="conClient">The connected API Client</param>
        public static async Task EvaluateExpression(IConnectionApiClient conClient)
        {
            string filePath = "Inputs/User_testing_end_v23_1.ideaCon";
            await conClient.Project.OpenProjectAsync(filePath);

            var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
            int connectionId = connections[0].Id;

            // The request body must be a JSON string literal, so wrap the expression in quotes.
            string expression = "15*2";
            string result = await conClient.Parameter.EvaluateExpressionAsync(conClient.ActiveProjectId, connectionId, $"\"{expression}\"");
            Console.WriteLine($"Expression '{expression}' evaluated to: {result}");

            // An expression can also reference parameters defined in the connection.
            // 'NoCols' is an existing parameter (number of bolt rows) in this project.
            string parameterExpression = "NoCols*2";
            string parameterResult = await conClient.Parameter.EvaluateExpressionAsync(conClient.ActiveProjectId, connectionId, $"\"{parameterExpression}\"");
            Console.WriteLine($"Expression '{parameterExpression}' evaluated to: {parameterResult}");

            //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/4/projects/{projectId}/connections/{connectionId}/evaluate-expression

Using the EvaluateExpressionWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Evaluate the expression and return the result.  For more details see documentation about parameters:  https://developer.ideastatica.com/docs/api/api_parameters_getting_started.html  or  https://developer.ideastatica.com/docs/api/api_parameter_reference_guide.html
    ApiResponse<string> response = conClient.Parameter.EvaluateExpressionWithHttpInfo(projectId, connectionId, body);
    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 ParameterApi.EvaluateExpressionWithHttpInfo: " + 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]

GetParametersAsync

List<IdeaParameter> GetParametersAsync (Guid projectId, int connectionId, bool? includeHidden = null)

Gets all parameters defined for the specified project and 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 connection from which to retrieve parameters.
includeHidden bool? If true, includes hidden parameters in the result. [optional] [default to false]

Return type

List<IdeaParameter>

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 GetParametersAsyncExample
    {
        public static async Task Main()
        {
            string ideaConFile = "testCon.ideaCon";
            
            string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 25.1"; // 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 from which to retrieve parameters.
                    includeHidden = false;  // bool? | If true, includes hidden parameters in the result. (optional)  (default to false)

                    try
                    {
                        // Gets all parameters defined for the specified project and connection.
                        List<IdeaParameter> result = await conClient.Parameter.GetParametersAsync(projectId, connectionId, includeHidden);
                        Debug.WriteLine(result);
                    }
                    catch (ApiException  e)
                    {
                        Console.WriteLine("Exception when calling Parameter.GetParametersAsync: " + 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>
        /// Get the parameters defined in a connection.
        /// </summary>
        /// <param name="conClient">The connected API Client</param>
        public static async Task GetParameters(IConnectionApiClient conClient)
        {
            string filePath = "Inputs/User_testing_end_v23_1.ideaCon";
            await conClient.Project.OpenProjectAsync(filePath);

            var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
            int connectionId = connections[0].Id;

            // Get only the visible parameters of the connection.
            List<IdeaParameter> parametersVisible = await conClient.Parameter.GetParametersAsync(conClient.ActiveProjectId, connectionId, false);

            // Pass 'true' to also include the hidden parameters.
            List<IdeaParameter> parametersAll = await conClient.Parameter.GetParametersAsync(conClient.ActiveProjectId, connectionId, true);

            Console.WriteLine($"Connection {connectionId} has {parametersVisible.Count} visible parameter(s) ({parametersAll.Count} including hidden).");

            foreach (IdeaParameter parameter in parametersVisible)
            {
                Console.WriteLine($"Key= {parameter.Key}, Expression= {parameter.Expression}, Value= {parameter.Value}, Unit= {parameter.Unit}, Type= {parameter.ParameterType}");
            }

            //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/4/projects/{projectId}/connections/{connectionId}/parameters

Using the GetParametersWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Gets all parameters defined for the specified project and connection.
    ApiResponse<List<IdeaParameter>> response = conClient.Parameter.GetParametersWithHttpInfo(projectId, connectionId, includeHidden);
    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 ParameterApi.GetParametersWithHttpInfo: " + 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]

UpdateAsync

ParameterUpdateResponse UpdateAsync (Guid projectId, int connectionId, List ideaParameterUpdate = null)

Updates parameters for the specified connection in the project with the values provided.

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 update.
ideaParameterUpdate List<IdeaParameterUpdate> New values of parameters to apply. [optional]

Return type

ParameterUpdateResponse

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 UpdateAsyncExample
    {
        public static async Task Main()
        {
            string ideaConFile = "testCon.ideaCon";
            
            string ideaStatiCaPath = "C:\\Program Files\\IDEA StatiCa\\StatiCa 25.1"; // 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 update.
                    var ideaParameterUpdate = new List<IdeaParameterUpdate>(); // List<IdeaParameterUpdate> | New values of parameters to apply. (optional) 

                    try
                    {
                        // Updates parameters for the specified connection in the project with the values provided.
                        ParameterUpdateResponse result = await conClient.Parameter.UpdateAsync(projectId, connectionId, ideaParameterUpdate);
                        Debug.WriteLine(result);
                    }
                    catch (ApiException  e)
                    {
                        Console.WriteLine("Exception when calling Parameter.UpdateAsync: " + 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>
        /// Update the parameters of a connection with new values.
        /// </summary>
        /// <param name="conClient">The connected API Client</param>
        public static async Task Update(IConnectionApiClient conClient)
        {
            string filePath = "Inputs/User_testing_end_v23_1.ideaCon";
            await conClient.Project.OpenProjectAsync(filePath);

            var connections = await conClient.Connection.GetConnectionsAsync(conClient.ActiveProjectId);
            int connectionId = connections[0].Id;

            // Parameter expressions are always strings - e.g. "3", not 3.
            // 'NoCols' is an existing parameter (number of bolt rows) in this project.
            List<IdeaParameterUpdate> updates = new List<IdeaParameterUpdate>
            {
                new IdeaParameterUpdate() { Key = "NoCols", Expression = "3" }
            };

            ParameterUpdateResponse response = await conClient.Parameter.UpdateAsync(conClient.ActiveProjectId, connectionId, updates);

            Console.WriteLine($"Parameters set to model: {response.SetToModel}");

            foreach (IdeaParameterValidationResponse failed in response.FailedValidations)
            {
                Console.WriteLine($"Validation failed for '{failed.Key}': {failed.Message} ({failed.ValidationStatus})");
            }

            IdeaParameter updatedParameter = response.Parameters.FirstOrDefault(p => p.Key == "NoCols");
            if (updatedParameter != null)
            {
                Console.WriteLine($"Parameter '{updatedParameter.Key}' updated: Expression= {updatedParameter.Expression}, Value= {updatedParameter.Value}");
            }

            string exampleFolder = GetExampleFolderPathOnDesktop("Update");

            // Save updated file.
            string fileName = "updated-parameters.ideaCon";
            string saveFilePath = Path.Combine(exampleFolder, fileName);
            await conClient.Project.SaveProjectAsync(conClient.ActiveProjectId, saveFilePath);

            Console.WriteLine("File 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/4/projects/{projectId}/connections/{connectionId}/parameters

Using the UpdateWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Updates parameters for the specified connection in the project with the values provided.
    ApiResponse<ParameterUpdateResponse> response = conClient.Parameter.UpdateWithHttpInfo(projectId, connectionId, ideaParameterUpdate);
    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 ParameterApi.UpdateWithHttpInfo: " + 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]