CubeExampleAPI
Simple examples in C#, VBA and VB script of how to use the Tekla Tedds calculator to work out the volume of a cuboid.
Assign variables , evaluate expressions and return the results
This is a very simple Tekla Tedds API example which prompts the user for the 3 dimensions of a cube and then uses Tekla Tedds to calculate the volume of the cube which is reported to the user. The example uses dimensions which are checked throughout the inputs and outputs.
The aim of the example is to demonstrate how to assign variables in Tekla Tedds (input), evaluate expressions (processing) and then return the results (output) to the calling application.
It doesn't matter whether you want to just calculate a few simple maths expressions, integrate with an existing Tekla Tedds calculation or integrate with a completely new Tekla Tedds calculation understanding these three basic principles will allow you to start integrating Tekla Tedds into your own software solutions.
The source code
The source code for the examples is provided in three languages:
- C# (Windows UI application)
- VB script (command line application)
- VBA (Excel spreadsheet)
Instructions
To use the examples follow the steps below:
- Click Get code on the top of this page
- Download and extract the zip file to a directory on your system
- Excel VBA
- Open the file Tedds API Example.xlsm in Excel
- Enter the dimensions of the cube, amend the units as necessary and amend the result units if required
- Click the Calculate Volume button
- VB Script
- Browse to the VB Script directory where you extracted the zip file
- Right click on the CalculateVolume.vbs file and select Open with Command Prompt
- When prompted enter the dimensions, units and the result units
- C#
- Open the solution TeddsApiExample.sln in Microsoft Visual Studio
- Build the solution
- Run the example application
- Enter the dimensions, select the appropriate units and then click Calculate Volume to see the result