How to create a User Interface - Part 7

Tekla Tedds
Tekla Tedds for Word
Not version-specific
Tekla Tedds Tekla Tedds for Word
Environment
Canada
Australia
British Standard
Eurocode
USA
This is the seventh part of a step-by-step guide showing you how to use the Tedds Interface Designer to create user interfaces for your own custom calculations. In this part, you will enhance the user interface created in part 6 to use Active Sketches that are drawn using the actual properties of the selected section and include appropriate dimensions.
This guide is written for Word 2007/2010, some of the steps described may be slightly different if you are using a different version of Word.

Creating an Active sketch

For the purpose of this example your first task is to create Active Sketches for each of the steel section types that can be selected (I, Channel, T, etc.) which you will do by using the Tedds drawing functions. If you're unfamiliar with creating Active Sketches please refer to the article Create your own Active Sketches.

 

Start a new Tedds for Word document and type the following expressions which will draw an I section and label the key dimensions of the section:

 

DrawCreateDrawing( B, D ) = ?
DrawFont( "Arial", max(B, D) / 20 ) = ?
DrawFillOutline( True ) = ?
DrawFillPolygon( 0mm, 0mm, 0mm, T, B/2-t/2, T, B/2-t/2, D-T, 0mm, D-T, 0mm, D, B, D, B, D-T, B/2+t/2,D-T, B/2+t/2, T, B, T, B, 0mm ) = ?
DrawDimensionLineCap( "BarAutoArrow" ) = ?
DrawDimensionAlignment( "Near", 5mm ) = ?
DrawDimensionLine( B/2-t/2, D/2, B/2+t/2, D/2, "t" ) = ?
DrawDimensionLine( 0mm, D, B, D, "B" ) = ?
DrawDimensionLine( 0mm, 0mm, 0mm, D, "D" ) = ?
DrawDimensionAlignment( "Far" ) = ?
DrawDimensionLine( B, 0mm, B, T, "T" ) = ?

 

Image
Image1.png

Storing a sketch

Once you have written the expressions that will create your sketch it must be saved to a Calc Library so that your user interface can calculate and then show the appropriate sketch. You can do this using the same techniques you learnt in part 6.

 

  1. Open the Library Access System (LAS).
  2. From the File menu select New Blank Set.
  3. From the Edit menu select New Item.
  4. When prompted to select the Word content to save, make sure you select all of the expressions that create your Active Sketch.
  5. For the item Name enter Section sketch - I.
  6. For the Library, click the Select... button and then enter the file name Steel section tie design
  7. If you're prompted to overwrite the existing static sketch you created in part 6 answer Yes.

 

Tip: When you save an Active Sketch as a Calc Item to show in a user interface never include the ShowDrawing field that you would normally use to show an Active Sketch in a document. If you do the ShowDrawing field will cause the sketch to be destroyed and consequently nothing will appear in your user interface.

 

Repeat the steps above to create similar sketches for each of the section types that can be selected from the Data list as separate Calc Items with the appropriate item name. You can determine the name to use for each sketch by checking the value of the 'type' variable when that section type is selected from the Data list. So for example the channel section sketch will be named "Section sketch - C" because for a channel section the type variable has a value of "C".

Showing an Active Sketch in the User Interface

Now that you have created all the required sketches you need to modify your existing user interface to show the new active sketches instead of the old static sketches.
  1. Start editing the user interface.
  2. Select the sketch window by clicking on it.
  3. Change the Display property to Active Sketch.

 

Image
Image2.png
When you re-calculate your document you should see your new I section Active Sketch shown in the user interface.

Summary

You've now updated your Tedds user interface to show the user an Active Sketch of the steel section they've selected. Adding Active Sketches to your user interfaces will help to make them easier to use by others because the sketch provides additional information to the user. You can find out more about creating your own user interfaces by searching for "Interface Designer" in the Tedds help.
Was this helpful?