ST2R
Files
- St7CloseModelComponent.cs
`St7CloseModelComponent.cs` is a Grasshopper plugin component designed to close an open Straus7 structural analysis model. It functions by accepting a specific model identifier (uID) as input and triggering the `St7CloseFile` API method when its custom "Close" button is pressed. The component returns a debug log list indicating success or specific error codes, such as invalid IDs or general failure states. Key components include the `SolveInstance` method for execution logic, input/output parameter registration, and event handling for the UI button trigger.
- St7CloseResultFileComponent.cs
This file defines a Grasshopper component named `St7CloseResultFileComponent` that integrates with the Straus7 API to close open result files for specific structural models. It accepts a single integer input representing the model's unique ID and outputs a list of debug log messages indicating the operation's status. The component utilizes a custom "Close" button interface to trigger execution, ensuring the action is performed on demand rather than automatically during every solve. Inside the `SolveInstance` method, it calls the `St7CloseResultFile` API function and handles various error codes, such as success or the absence of an open file. This tool is designed to help users manage memory and file locks within the Grasshopper environment by explicitly releasing resources associated with a given Straus7 model.
- St7GetAllBeamConnectivityComponent.cs
This file defines a Grasshopper component named `St7GetAllBeamConnectivityComponent` that retrieves structural connectivity data from a Straus7 model. It takes a specific model ID as input and iterates through all beams to extract their node connections using the St7API. The component outputs three main data structures: beam numbers, the count of nodes per beam, and the specific node IDs for each element. A custom button triggers the data retrieval process, which populates these outputs along with a debug log list. This tool facilitates the transfer of finite element mesh topology from Straus7 into the Grasshopper environment for further analysis or visualization.
- St7GetAllLinkConnectivityComponent.cs
This file defines a Grasshopper component named `St7GetAllLinkConnectivityComponent` that extracts connectivity data for all links from a Straus7 structural analysis model. It takes a unique model ID as input and iterates through every link to determine its type and associated node connections using the St7API. The component handles various specific link types, such as master-slave, rigid, and coupling links, by calling specialized API functions for each case. Results are organized into GH_Structures containing link numbers, node counts, and specific node indices, while debug messages are collected in a log list. A custom button attribute triggers the solution execution, allowing users to manually refresh the data when needed.
- St7GetAllNodesXYZComponent.cs
This file defines a Grasshopper component named `St7GetAllNodesXYZComponent` that extracts node coordinates from a Straus7 structural analysis model. It accepts a specific model identifier (`uID`) as input and uses a button trigger to initiate the data retrieval process, ensuring efficient execution only when explicitly requested. The core logic iterates through nodes sequentially using the `St7API`, collecting their unique numbers and corresponding [X, Y, Z] coordinate arrays until an error code indicates no more nodes exist. Results are organized into hierarchical tree structures for both node indices and coordinates, facilitating easy integration with other parametric modeling tools. Additionally, it provides a debug log listing each processed node's details and any potential errors encountered during extraction.
- St7GetAllPlateConnectivityComponent.cs
This file defines a Grasshopper component named `St7GetAllPlateConnectivityComponent` that interfaces with the Straus7 API to extract structural plate connectivity data. Its primary function is to iterate through all plates in a specified model (identified by `uID`) and retrieve their associated node numbers, storing this hierarchical data in output trees. Key components include input parameters for the model ID and outputs for plate numbers, node counts, and specific node indices, alongside a debug log. The logic utilizes a loop calling `St7GetElementConnection` until no more plates are found, handling errors gracefully. It employs a custom button attribute to trigger execution via `ExpireSolution`, ensuring efficient on-demand processing within the Grasshopper environment.
- St7GetBeamSelectStateComponent.cs
This file defines a Grasshopper component named `St7GetBeamSelectStateComponent` that interfaces with the Straus7 structural analysis software. It retrieves the selection state of a specific beam within a given model by accepting the model's unique ID and the beam number as integer inputs. The core logic utilizes the `St7API` to query whether the beam is selected in Local 0, returning the result as a boolean output. Additionally, it provides a debug log list to report success messages or any API errors encountered during execution. Key components include input registration for parameters, a custom button attribute for manual solution expiration, and error handling logic to ensure robust data retrieval.
- St7OpenModelComponent.cs
This file defines a Grasshopper component named `St7OpenModelComponent` that interfaces with the Straus7 FEA API to open structural analysis models. Its primary function is to load a specified model file into memory, allocating a unique integer ID (uID) from a static pool to manage concurrent sessions. The component utilizes a manual "Open" button trigger rather than automatic solving to control execution timing and resource management. Key components include input validation for the model path, initialization of the St7 API, and error handling that logs detailed messages or releases allocated IDs upon failure. It outputs the assigned model ID and a debug log list, ensuring robust interaction with the external engineering software within the Rhino/Grasshopper environment.
- St7ReadBeamForcesWithEnvelopesComponent.cs
This C# file defines a Grasshopper component named `St7ReadBeamForcesWithEnvelopesComponent` that extracts beam force data from Straus7 structural analysis result files. It serves as an interface between the St7API and the Grasshopper environment, allowing users to read internal forces like axial load, shear, torsion, and bending moments for specified beams. The component supports reading envelopes by generating them via the API and organizing outputs into hierarchical trees based on beam numbers and load cases. Key inputs include the model ID, result file path, target beam numbers, minimum station count, and reference coordinate system, while outputs provide structured data for positions and force components (Fx, Fy, Fz, Mx, My, Mz).
- St7ReadBeamGlobalDispComponent.cs
This file defines a Grasshopper component named `St7ReadBeamGlobalDispComponent` that integrates the Straus7 structural analysis API into Rhino/Grasshopper. Its primary function is to read global displacement and rotation results (Dx, Dy, Dz, Rx, Ry, Rz) for specified beams from .NLA/.NLF result files. Key components include input parameters for the model ID, result file path, beam numbers, and minimum station count, alongside outputs structured as data trees for positions and displacements. The logic handles file opening, envelope generation, and iterative reading of beam result arrays, providing error logging and debug messages through its output interface.
- St7ReadBeamVonMisesComponent.cs
This file defines a Grasshopper component named `St7ReadBeamVonMisesComponent` that integrates the Straus7 API to extract beam stress data. Its primary function is to read Von Mises stress values from specified result files (.NLA/.NLF/.RST) for given beam IDs and load cases. Key components include input parameters for model ID, file path, and beam numbers, alongside outputs for case names, station positions, and stress trees. The logic utilizes a manual "Read" button trigger to open the result file, generate envelopes, and iterate through beams and cases to populate GH_Structure trees with the extracted numerical data.
- St7ReadGroupComponent.cs
This file defines a Grasshopper component named `St7ReadGroupComponent` that integrates with the Straus7 structural analysis API. Its primary function is to retrieve a list of all group names defined within a specific, already-opened Straus7 model identified by its unique ID. Key components include input parameters for the model's user ID and output ports for the resulting group list and debug log messages. The logic utilizes a manual "Read" button trigger to execute the data fetch, iterating through the API to collect groups until an error or end-of-list condition occurs. Finally, it manages the solution state by resetting the execution flag after processing completes.
- St7ReadLimitEnvelopeNamesComponent.cs
This file defines a Grasshopper component named `St7ReadLimitEnvelopeNamesComponent` that interacts with the Straus7 structural analysis software. Its primary function is to read and list the names of limit envelopes from a specified result file (.RST, .NLA, or .NLF) using an existing model session ID. The component takes two inputs—the model's unique ID and the result file path—and outputs a list of envelope names along with a debug log. Key implementation details include manual execution control via a custom "Read" button and error handling for API calls like `St7OpenResultFile` and `St7GetLimitEnvelopeData`. It utilizes the St7API namespace to retrieve envelope data iteratively, ensuring robust parsing even if individual envelope reads fail.
- St7ReadLoadCombinationNamesComponent.cs
This file defines a Grasshopper component named `St7ReadLoadCombinationNamesComponent` that extracts load combination names from Straus7 result files. It serves as a bridge between the FeMM plugin and the St7API, specifically targeting the ST2R bake subcategory. The component requires two inputs: a model ID (`uID`) and the path to a `.RST`, `.NLA`, or `.NLF` result file. Upon executing the "Read" button, it opens the specified file via `St7OpenResultFile` and iterates through primary load combinations using `St7GetLSACombinationName`. Key components include input validation, error handling for API calls, and outputting both the extracted names and a debug log of the process.
- St7ReadResultCasesComponent.cs
This file defines a Grasshopper component named `St7ReadResultCasesComponent` designed to extract load case names from Straus7 result files. It inherits from `GH_Component` and integrates with the FeMM.Grasshopper framework, specifically targeting the ST2R bake subcategory. The component accepts two inputs: a unique ID for an open Straus7 model and the full path to a result file (e.g., .RST, .NLA). Upon executing its custom "Read" button, it uses the St7API to open the file and iteratively retrieves case names until no more are found. Key outputs include a list of extracted case names and a debug log detailing the process or any errors encountered.
- St7SaveModelComponent.cs
This file defines a Grasshopper component named `St7SaveModelComponent` that integrates with the Straus7 structural analysis API. Its primary function is to save an open Straus7 model identified by a specific user ID, triggered manually via a custom "Save" button rather than automatic solution cycles. The component accepts one integer input for the model ID and outputs a list of text-based debug log messages indicating success or error codes from the underlying API call. Key components include the manual execution logic using a `_run` flag, the interaction with `St7.St7SaveFile`, and standard Grasshopper lifecycle methods like `SolveInstance` and `RegisterInputParams`.
- St7SelectBeamsByGroupComponent.cs
This file defines a Grasshopper component named `St7SelectBeamsByGroupComponent` that interfaces with the Straus7 structural analysis software via the St7API. Its primary function is to select beam elements belonging to specific user-defined groups within a given model instance, identified by a unique ID. The component accepts integer inputs for the model ID and a list of group IDs, adjusting these values internally before calling API methods to set the selection state. It provides feedback through output parameters displaying the total number of beams in the model, the count of currently selected beams, and a text log detailing the execution steps or any errors encountered. To prevent automatic re-execution during every solve cycle, the component utilizes a manual "Apply" button mechanism that triggers the logic only when explicitly activated. Key components include input/output parameter registration, error handling for API calls, and a debug logging system to assist users in troubleshooting selection issues.
- St7SetNodeXYZComponent.cs
This file defines a Grasshopper component named `St7SetNodeXYZComponent` that updates node coordinates within a Straus7 structural analysis model. It accepts a model ID, specific node number, and XYZ coordinate data as inputs, then executes the update only when a custom "Set" button is pressed to trigger the solution. The core logic validates that exactly three numeric values are provided for the specified node before calling the external `St7.St7SetNodeXYZ` API function. Finally, it outputs a boolean success status and a detailed log list indicating whether the operation succeeded or encountered an error.