Scripting

Inhalt

Index

Using scripting, respectively prepared TCL files can be executed via associated XML files on the basis of the TCL script language, whereby the defined command lines are executed and the corresponding data is generated in the project. In doing so, the entire scope of the TCL script language can be used (see the last main chapter of the help: TCL Script Guide).

Thereby, the XML file references the procedure defined in the TCL file and its used arguments, which can be assigned values via the user interface before execution.

A basic possibility for the practical application of this is to create parts of the project automatically as often as required (at different locations) by changing certain parameters accordingly.

To execute a TCL script file

  1. Click Scripting.
  2. Click Load script in the opening input window.
  3. Select the XML file associated with the TCL file, which references the TCL script and contains the arguments to be defined.

    The respective arguments are now displayed in the window with their defined default values and can be edited there.

    The name of the referenced TCL file and its directory are informatively displayed, as are the description and the variable type in the General section.

    The tooltip of a specific argument shows respective information of the TCL file.

  4. Use the corresponding button to optionally load additional XML files of TCL scripts which are displayed in separate tabs.
  5. Use the corresponding buttons to execute the TCL script referenced via the XML file and then optionally close the input window automatically.

    Note: The corresponding checkbox in the Options section at the top of the window can be used to automatically recalculate the project after the script has been executed, which may be necessary in order to display all generated data correctly.

    In the log window at the bottom of the input window, corresponding notes and error messages are displayed.

Recommended basic procedure for creating a script

1. Define the project parts that you want to create using a script in the usual way via the user interface.

2. Export the project thus defined to a TCL file.

3. Adapt the contents of the TCL file to the desired data to be created. Test the correctness of the script and the created data using a partial TCL import (option Add).

4. Specify the parameters to be changed using arguments and create a corresponding XML file.

5. Load the XML file and execute the script.

6. Optionally, add the template to the project templates in the installation directory.

Examples of use:

Generating a series of (e.g. transversal) axes at different positions along an axis and with different boundary conditions (heights, angles, etc.)

Generating a series of structural members (girders, piers, link girders, prisms) at different positions and with different dimensions

Generating (standard) cross sections with variables and thus freely definable dimensions

Placing a group of tendons (strands) in a series of precast beams

Applying cross sections at specific positions along the stationing of a structural member (e.g. transverse stiffeners in a steel girder)

Generating a series of result presentations (diagrams, tables) with different result components

Adding user-defined columns in results tables with specific mathematical relationships in reference to other results



Allplan

(C) ALLPLAN GmbH

Privacy policy