How to create a User Interface - Part 4

Tekla Tedds - Not version-specific Tekla Tedds for Word - Not version-specific
Environment
Not environment-specific
This is the fourth 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 3 to be more interactive by showing the currently selected section in the user interface and hiding input controls that are not relevant.

 

This guide is written for Word 2007/2010 some of the steps described may be slightly different if you are using an older version of Word.

Feedback

A key aspect of user interface design is to allow the user to easily discover the input they currently have defined. In the previous part of this series you enhanced the user interface to allow the user to select a predefined section but once they have selected a section there is no easy way to find out what the currently selected section is. In this part of the guide you will enhance the user interface to show the currently selected section.

Enhancing the user interface

When an item is selected from a Tedds data list a variable called Name is always written to the document which stores the name of the selected section. You will now modify the description displayed to the left of the select Section... button to show the value of the Name variable so that the user knows which section is currently selected.

 

  1. Open the document created in part 3 and start editing the user interface.
  2. Select the Section... input control.
  3. Change the Description property by entering the expression =GetVar("Name", "No section selected")

 

To retrieve the value of the Name variable the expression uses the Tedds GetVar function. You could have just used the expression Name which would return the value of the name variable, however the first time a user ran the calculation there would be no Name variable so the expression would cause an undefined variable error. The second parameter of the GetVar function allows you to specify a default value that will be returned only if the variable does not exist, in this case the string "No section selected".
 
Close the user interface, return your changes to the document and then re-calculate the document.

 

Image
Enhancing interface

In the US environment, you would see this:

Image
Tedds Interface - Section Details

 

You should now see the improvement to the user interface, when you select a different steel section the description label will update to show you the currently selected section. However there is now a problem, the user can still modify the section properties by using input controls for A, rxx and ryy. If they change any of these properties then the description stating which section is selected is no longer correct because the values no longer reflect the real properties of that section.
 
You will now resolve this problem by letting the user choose whether they want to define a custom section or select a standard predefined section. When the user selects a standard section the input controls for A, rxx and ryy will be disabled so that the values cannot be overidden.
 
  1. Start editing the user interface.
  2. At the start of the Steel section group add a new Check Box input control.
  3. Change the Name property to customSection.
  4. Change the Description property to Custom section.
  5. Select the Section... input control.
  6. Change the Enable If property to the expression customSection==0.
  7. Change the Hide if disabled property to True.
  8. Select the Section area input control.
  9. Change the Enable If property to the expression customSection==1.
  10. Select the Radius of gyration about x input control.
  11. Change the Enable If property to the expression customSection==1.
  12. Select the Radius of gyration about y input control.
  13. Change the Enable If property to the expression customSection==1.
The Custom Section check box will assign a value of either 1 or 0 to the customSection variable depending on whether the check box is checked or unchecked. The expressions for each of the Enable If properties will then check the value of the customSection variable and enable or disable that particular input control as appropriate.
 
Close the user interface, return your changes to the document and then re-calculate the document.
Image
Tedds Interface - Section details
Image
Tedds Interface - Custom Section

 

 In the US environment, you would see this:

Image
Tedds Interface - Section Details
Image
Tedds Interface - Custom Sections
You should now see the improvement to the user interface, when you check the option to use a custom section, the Section... button is hidden and you can manually enter all of the section properties to define any section. When the Custom section option is unchecked you can select a standard section but you can no longer modify the section properties, however you can still read those properties as the input controls are disabled but still visible.

Summary

You've now updated your Tedds user interface to be more interactive by providing feedback to the user as well as allowing them to use either custom sections or standard sections. You can find out more about creating your own user interfaces by searching for "Interface Designer" in the Tedds help.

See also

How to create a User Interface - Part 5. The next part of this step-by-step guide which will show you how to enhance your user interface to ensure that sensible data has been entered by the user.
Was this helpful?
Submit