CubeExampleAPI

Updated: 17 Jan 2024

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: 

  1. Click Get code on the top of this page
  2. Download and extract the zip file to a directory on your system 
  3. Excel VBA 
    1. Open the file Tedds API Example.xlsm in Excel 
    2. Enter the dimensions of the cube, amend the units as necessary and amend the result units if required  
    3. Click the Calculate Volume button 
  4. VB Script 
    1. Browse to the VB Script directory where you extracted the zip file 
    2. Right click on the CalculateVolume.vbs file and select Open with Command Prompt 
    3. When prompted enter the dimensions, units and the result units 
  5. C# 
    1. Open the solution TeddsApiExample.sln in Microsoft Visual Studio 
    2. Build the solution 
    3. Run the example application 
    4. Enter the dimensions, select the appropriate units and then click Calculate Volume to see the result 
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.