SAPExtra
Files
- ExtraSapHelper.cs
This file defines the `ExtraSapHelper` class, a utility component within the FeMM Grasshopper plugin that bridges Rhino geometry data with the SAP2000 structural analysis API. It primarily functions to translate internal model objects (nodes, beams, plates) into SAP2000-compatible labels and to create frame section properties by mapping various standard shapes like I-beams, channels, and generic polygons to specific SAP2000 API methods. The code handles critical translation tasks such as applying material mappings, managing dimensional multipliers for scaling, and processing complex generic shapes via polygon definitions. Additionally, it includes error handling mechanisms to capture and report failures or warnings during the property creation process back to the user interface.
- SAPAddLoadCase.cs
This file defines a Grasshopper component named `SAPAddLoadCase` that automates the creation and configuration of load cases within the SAP2000 structural analysis software. It functions by accepting inputs for model references, load case names, load patterns with associated factors, and specific load types (such as linear, envelope, or nonlinear). The core logic initializes a connection to the SAP2000 API, iterates through the provided data branches, and programmatically sets static linear or nonlinear load cases using the CSI COM objects. Key components include input parameters for model identification and load definitions, a manual "Run" button trigger to execute the solution, and an output boolean indicating success or failure. Additionally, it handles type conversion for nonlinear options like P-Delta effects before saving the updated model file.
- SAPAreaLoaderComponent.cs
`SAPAreaLoaderComponent.cs` is a Grasshopper plugin component designed to transfer structural load data from SAP2000 analysis models into FeMM plate objects. It operates by connecting to a specified SAP2000 executable and model file, then iterating through area objects to match them with input plates based on unique identifiers. The component extracts uniform frame loads and other distributed loads associated with specific load patterns, filtering them if a selection is provided. Key components include the `GH_Component` base class for Grasshopper integration, an explicit "Run" button mechanism to trigger execution, and helper methods like `ExtraSapHelper.InitializeModel` to manage the OAPI connection. Finally, it updates the input plate list with the newly loaded data and provides development logs via an output parameter for debugging purposes.
- SAPBeamLoaderComponent.cs
This file defines a Grasshopper plugin component named `SAPBeamLoaderComponent` that integrates Rhino’s visual programming environment with SAP2000 structural analysis software. Its primary function is to read distributed loads from an existing SAP2000 model and apply them to corresponding beam geometry inputs within the Grasshopper definition. The component utilizes the SAP2000 API via helper classes to connect to the specific application instance and retrieve load pattern data for selected frame objects. Key components include input parameters for beam lists, SAP model paths, and optional load filters, alongside a custom "Run" button mechanism that triggers the asynchronous data extraction process. The core logic iterates through beams in the SAP model, matches them to Grasshopper inputs by unique ID, and extracts detailed load distribution values such as direction, magnitude, and coordinates. Finally, it outputs the updated beam geometries enriched with this structural load data, while providing debug information through a secondary output parameter.
- SAPBeamResultFilterComponent.cs
This file defines a Grasshopper component (`SAPBeamResultFilterComponent`) that filters structural analysis results for beams from SAP2000 simulations. It processes input lists of beam data to identify worst-case force values (such as bending moments, shear forces, and axial loads) at specific stations along each beam. The component supports options to use local axes and filter exclusively for end-section results versus all intermediate points. Key components include logic to categorize results by station (initial, middle, end), calculate extreme values using helper methods, and clone the original beam objects with only the most critical filtered results retained.
- SAPBeamsLoaderResultsComponent.cs
This file defines a Grasshopper component named `SAPBeamsLoaderResultsComponent` that retrieves structural analysis results from SAP2000 for specific beam elements. It functions by connecting to an existing or new SAP2000 instance, selecting specified load cases or combinations, and extracting internal forces and displacements for input beams. Key components include input parameters for beam geometry, the SAP database file path, and target load cases, alongside output ports for updated beam data and processing logs. The implementation utilizes a background worker thread to handle the potentially time-consuming API communication without freezing the Grasshopper interface. Finally, it manages the synchronization between the external software state and the Grasshopper definition through manual solution expiration and result caching.
- SAPGetDesignFrameForceComponent.cs
This file defines a Grasshopper component (`SAPGetDesignFrameForceComponent`) that extracts frame design forces from SAP2000 models. It interacts with the SAP2000 API to read internal forces (axial, shear, torsion, and bending moments) for selected beams and load combinations. Key components include input parameters for model path, executable location, and specific groups or load cases, alongside output data structures organizing results by beam ID, station, and force type. The logic validates the connection state, ensures the analysis is complete, and iterates through designated structural elements to populate GH_DataTree outputs.
- SAPGetFrameForceComponent.cs
This file defines a Grasshopper component named `SAPGetFrameForceComponent` that extracts internal force results from SAP2000 frame elements. It functions by connecting to an active or new SAP2000 instance, validating the model state, and retrieving axial, shear, torsion, and bending forces for specified beams. Key components include input parameters for model path, attachment mode, executable location, and filters for groups and load cases. The logic utilizes the SAP2000 API to query object assignments and export data into structured trees based on user selection. Finally, it outputs these numerical results along with beam IDs and station coordinates for further analysis in the visual programming environment.
- SAPGetFrameJointForceComponent.cs
This C# file defines a Grasshopper component named `SAPGetFrameJointForceComponent` that retrieves structural analysis results from SAP2000 for frame elements. It functions by connecting to an existing SAP2000 instance or opening a specified model file, validating that the analysis is complete, and extracting internal forces based on user-defined groups and load cases. Key components include input parameters for the model path, execution mode, target groups, and specific load combinations, which drive the data extraction logic. The component utilizes the SAP2000 API to iterate through selected beams, fetching axial force, shear, torsion, and bending moments at various stations along each element. Finally, it outputs these results as structured lists and trees of numerical data, including beam IDs, stations, and corresponding force values, facilitating downstream structural checks within the Rhino/Grasshopper environment.
- SAPGetJointDisplacementComponent.cs
This file defines a Grasshopper component named `SAPGetJointDisplacementComponent` that retrieves structural displacement results from SAP2000 analysis models. It functions by connecting to an existing SAP2000 instance or opening a specified model file, validating that the analysis is complete and unlocked for reading. The component accepts inputs for the model path, execution mode, specific joint groups, and target load cases to filter the data scope. Its key components include input parameters for model configuration and output ports that export joint IDs, local/global coordinate vectors, and displacement values (U1-U3) organized in trees. Ultimately, it serves as a bridge for exporting detailed node displacement data from SAP2000 into the Grasshopper environment for further geometric or analytical processing.
- SAPGetWorstComboComponent.cs
This file defines a Grasshopper component (`SAPSetDesignComboComponent`) that configures SAP2000 steel design parameters via automation. It allows users to specify which structural groups and load combinations (for strength or deflection) should be included in the design process. The component connects to an existing SAP2000 instance or opens a specified model file upon pressing a custom "Run" button. Its core logic iterates through all defined groups and combinations, enabling or disabling them based on user inputs while leaving others unchanged. Error handling ensures the process stops if the model path is invalid or the connection fails. This tool facilitates interactive control over SAP2000’s design criteria directly within the Grasshopper environment.
- SAPNodeLoaderComponent.cs
This file defines `SAPNodeLoaderComponent`, a Grasshopper plugin component designed to extract structural node data from SAP2000 analysis results. It functions by connecting to a specified SAP model file and iterating through defined load patterns to retrieve force and moment values for specific nodes. Key components include input parameters for FEMM nodes, the SAP model path, optional load pattern filters, and the SAP executable location, alongside outputs for updated node data and development logs. The logic utilizes the SAP OAPI to query point object loads, validating that all nodes possess unique IDs before processing. Upon execution, it matches input nodes with SAP model names and attaches corresponding global axis forces and moments to the Grasshopper data tree.
- SAPSetDesignTargetDisplacementComponent.cs
This file defines a Grasshopper component (`SAPSetDesignTargetDisplacementComponent`) within the FeMM plugin ecosystem, designed to configure lateral displacement targets for steel design in SAP2000. It functions as an interactive tool that allows users to specify model paths, load cases, and specific point IDs to assign target displacement values. Key components include input parameters for model connection (via path or instance attachment), lists of load case names, point identifiers, and corresponding numerical displacement targets. The logic relies on a manual "Run" button to trigger execution, ensuring the solution only updates when explicitly requested by the user. Upon activation, it validates the inputs against the active SAP2000 model and calls the `SetTargetDispl` API method to apply these design constraints.
- SAPSetFrameExternalForceComponent.cs
This file defines a Grasshopper component (`SAPSetFrameExternalForceComponent`) designed to apply external forces to frame elements within the SAP2000 structural analysis software. It serves as an interface between Rhino/Grasshopper and SAP2000, allowing users to automate load case applications without manual intervention. Key components include input parameters for connecting to an existing SAP instance or launching a new one, along with tree-structured data for specifying frames, load cases, stations, and force values. The core logic resides in the `SolveInstance` method, which initializes the SAP API, validates input structures, and iteratively applies forces to the specified frame elements. A "Run" button triggers the execution, ensuring that the heavy computational task is performed on demand rather than continuously. Finally, it provides a text log output to report success or errors during the force application process.
- SAPSetWorstDesignComboComponent.cs
This file defines a Grasshopper component, `SAPGetWorstComboComponent`, designed to identify the worst structural load combinations for specific beam groups within an SAP2000 model. It functions by connecting to a running SAP2000 instance or opening a specified model file, verifying that analysis has been completed, and then selecting designated frame objects and load combinations for output review. The component iterates through selected beams and stations to filter results based on user-defined criteria, ultimately returning a list of the most critical combination names. Key components include input parameters for the model path, group selection, and station definitions, alongside an API-driven logic block that manages SAP2000 object selection and result extraction.
- SAPStartDesignComponent.cs
This file defines a Grasshopper component (`SAPStartDesignComponent`) that automates the steel design process within SAP2000. It serves as an interactive interface to open a specified SAP model, attach to an existing instance if needed, and initiate the steel design check for selected groups. The component validates inputs like the model path and handles errors by displaying runtime messages if the model is invalid or locked. Upon execution, it selects specific beam groups, runs the `StartDesign` method, and retrieves verification results. Key outputs include lists of checked beams, those that failed design checks, and those not yet evaluated. Finally, it manages UI visibility based on a "Hide" flag and resets its internal run state upon completion.