| Table of Contents |
|---|
Overview
With the release of ETABS v22.0.0 , SAFE v22.0.0 , SAP2000 v26.0.0 , and CSiBridge v26.0.0 , it is now possible to create plugins for CSI products using .NET 8 . To learn more about the .NET 8 platform , please see What's new in .NET 8 . This example will guide a developer through creating a simple .NET 8 plugin using the C# programming language. By making use of the cross-product CSI API library, this example is compatible with ETABS v22.0.0 , SAFE v22.0.0 , SAP2000 v26.0.0 , and CSiBridge v26.0.0 (or a higher version of any of these). For an example plugin using .NET Framework, please see NET Framework Plugin Example .
Walkthrough
Prerequisites
This walkthrough uses Microsoft Visual Studio 2022 and the .NET 8 SDK. One of the following CSI products must be installed on the development computer: ETABS v22.0.0 , SAFE v22.0.0 , SAP2000 v26.0.0 , or CSiBridge v26.0.0 (higher versions of any product will also work)
...
Creating the plugin assembly
- Selecting C# as the language, create a new project of type Class Library. Ensure that the selected project type targets .NET or .NET Standard, not .NET Framework.
...
The file with extension deps.json will manage your plugin assembly's dependencies. Your plugin's dependencies will not interfere with those of CSI products. For instance, all CSI products make use of the Newtonsoft.Json package, but your plugin will only use the Newtonsoft.Json.dll present in the same folder as your plugin.
...
Using the plugin in a CSI product
Now
For download
...
Your project output directory should now contain your built plugin assembly ( CSiNET8PluginExample1.DLL ) and all of its dependencies, except CSiAPIv1.DLL . The steps below demonstrate how to call this plugin from within a CSI product. The screenshots below are of ETABS, but the steps are the same for every CSI product.
- From the Tools menu, select Add/Show Plugins
2. In the External Plugin Data form, click the Browse button.
3. In the file select dialog, navigate to your project output directory and select your plugin assembly ( CSiNET8PluginExample1.DLL )
4. Your plugin information is now displayed in the form.
- Plugin Name: This is the name of your plugin assembly and cannot be modified.
- Menu Text: A default menu text is assigned to your plugin. You can change this to any name you want, but it must not conflict with any other plugin.
- Plugin Path: The location of your plugin
Click the Add button to load your plugin.
5. You should now see your plugin in the list, with the status OK. If desired, you can click the Info button to see information about your plugin in a pop-up window.
6. Your plugin should now be available in the Tools menu. Clicking on it for the first time will bring up an info box before displaying the plugin form.
7. In the plugin form, you can enter any text you like, then click the button.
8. The CSI program will create a new model that displays your message with frame objects.
9. If you enter the text crash in the plugin textbox, a message box will appear with your chosen error code.
For download
Download the Visual Studio solution of this example, with an already built, ready-to-run plugin assembly: CSiNET8PluginExample1.zip
For developers who need to use .NET Framework 4.7.1 - 4.8.1 , an example .NET Framework 4.8 project is provided here: CSiFramework48PluginExample2.zip
References
...









