Create your own Active Sketches

Tekla Tedds
Not version-specific
Tekla Tedds Tekla Tedds for Word
One of the most exciting features in Tedds is the drawing system that allows Tedds calculations to create Active Sketches. Active sketches use the data input for a specific design to create sketches that are drawn to the correct proportions and will typically include any key dimensions.
Image
news_topic4_1.png

Active sketches are often included in the output of a calculation, they may also be displayed in the user interface of a calculation to assist you when entering design data.

Creating Active Sketches

Documentation for the drawing functions can be found by opening the Calc Writing Aids set from the calculation index in the Library Access System. Open the set then open the Tedds Functions group and then the Drawing Functions group. Although the number of functions listed may appear daunting at first, you only need a handful of them to create effective sketches. Many of the functions are only required for drawing some of the more complex sketches used by calculations in the Tedds Engineering Library.

Example 1

To create an active sketch using Tedds for Word you simply write calls to the library of Tedds drawing functions.
Start by creating a new blank Tedds for Word document. The first function you must call is the function to create a new drawing DrawCreateDrawing. This function expects two arguments which specify the width and height of the drawing you want to create.
DrawCreateDrawing( 1000mm, 1000mm ) = ?
Note: don't forget the = ? so that Tedds knows that this line of the document needs to be calculated.
Once a drawing is created you can use any of the drawing functions to add drawing primitives to the drawing, for example let's start by drawing a border around your drawing using the DrawRectangle function. This function requires four arguments, the x and y co-ordinate pair of the bottom left corner and the width and height of the rectangle.
DrawRectangle( 0mm, 0mm, 1000mm, 1000mm ) = ?
Finally to show your drawing on the page use the Tedds ShowDrawing field to output the completed drawing. Insert a new blank field in your document by pressing Ctrl+F9 and then type =CSC|CALL ShowDrawing()
Your document should look as follows.
DrawCreateDrawing( 1000mm, 1000mm ) = ?
DrawRectangle( 0mm, 0mm, 1000mm, 1000mm ) = ?
{=CSC|CALL ShowDrawing()}
Now calculate the document to view the sketch that Tedds creates.
Image
news_topic4_2.png

Tip: If you don't want to see the expressions that create the drawing in your final printed document just use one of the Tedds hidden calc styles such as Calc 4 Column (hidden) to format the expressions as hidden text.

Example 2

Now that you understand how to start a basic sketch you can create something more useful, a sketch of an I or W section. First you must define the properties of your section.
D = 127mm; B = 76mm; t = 4mm; T = 7.6mm;
Next you will use the DrawFillPolygon function to draw the section shape. The arguments we pass to this function are each of the co-ordinates that define the outline of the polygon starting from the origin (0,0) at the bottom left corner of the section, then working clockwise around the shape.
DrawCreateDrawing( B, D ) = ?
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 ) = ?
{=CSC|CALL ShowDrawing()}
Image
news_topic4_3.png

Example 3

Finally to complete your example sketch you can add the dimensions of the section by using the DrawDimensionLine function. This function requires the co-ordinates for the start and end of the dimension you want to label. You will also use the DrawDimensionLineCap function to define the symbol you want to draw at each end of the dimension and the DrawDimensionAlignment function to tell Tedds how to align the dimension relative to the co-ordinates including a small margin of 5mm. You can further improve the drawing by drawing the outline of the section by using the DrawPolygon function with the same co-ordinates used for filling the section.
D = 127mm; B = 76mm; t = 4mm; T = 7.6mm;
DrawCreateDrawing( B, D ) = ?
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 ) = ?
DrawPolygon( 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 ) = ?
DrawDimensionLine( 0mm, D, B, D ) = ?
DrawDimensionLine( 0mm, 0mm, 0mm, D ) = ?
DrawDimensionAlignment( "far" ) = ?
DrawDimensionLine( B, 0mm, B, T ) = ?
{=CSC|CALL ShowDrawing()}
Image
news_topic4_4.png

Note how Tedds has automatically calculated the length of the dimensions and drawn the text required. It has also automatically adjusted the arrows used and the location of the drawn text for small dimensions.

Summary

Example 3 shows you how to create an active sketch with just a few lines of Tedds calculations that will automatically create the required drawing based on the design data that you enter. Change the values of D, B, T or t, re-calculate the document and your sketch will update to reflect the changes.
There are many other drawing functions available which allow you to create complex sketches using lines, polygons, arcs and dimensions to name just a few.
Hopefully this brief introduction has given you some idea of what can be achieved relatively quickly and will encourage you to experiment and create your own Active Sketches. All the items which document the drawing functions in the Calc Writing Aids set include a working example, simply return the item to your Tedds for Word document make any changes and re-calculate the document to see the effect.
Was this helpful?