Code example: Create beams with splice connections
This Tekla Structures plug-in is a simple code example that creates beams and splice connections between them.
The plug-in uses the European environment, but code example can be changed by using other profiles, bolt standards and bolt sizes.
After downloading the TSOpenAPIExamples package from GitHub (button above), find SplicePluigin example at \Model\Plugins\SplicePlugin.
The code is divided into two parts. First, the beams are created, and then each splice is created. Creation of a splice can be divided again into two parts: creation of plates and then creation of bolts.
The Run() method
The Run() method does the following:
- Calculates the amount of beams that fit between picked points.
- Creates those beams and adds them to an array.
- Calls CreateSpliceConnection() with the array as argument.
The CreateSpliceConnection() method
The CreateSpliceConnection() method loops through the beams and does the following, starting from the second beam:
- Creates plates on both sides of the beam.
- Creates two bolt arrays to connect the plates.
Test example plug-in
You can test the plug-in in Tekla Structures as follows:
- In Microsoft Visual Studio, build the project SplicePlugin.csproj. The file is located at \Examples\Model\Plugins\SplicePlugin.
- Copy the created .dll file to \TeklaStructures\[version]\nt\bin\plugins. This adds your plug-in directly to the Applications & components Catalog in Tekla Structures.
- In Tekla Structures, open a model.
- Open Applications & components Catalog (Ctrl+F) and search for component SplicePlugin.
- Click the component in the catalog and select two points in the model.
The plug-in creates 6000mm long beams between those points and between the beams, splices are created. The splices are constructed from two plates and four bolts, two bolt arrays.
The result should look something like this:
A close-up of one of the splices: