31 - 3.5   Extend Time Macro

The Extend Time Macro add-on simplifies the macro interface by allowing you to use a simple loop to query the number of solution times in the dataset and advance the time step. This differs from the native Tecplot macro language as it does not require that you know the solution time of your data.

This add-on uses a different algorithm than Tecplot 360 EX for sorting the solution times. Because Tecplot 360 EX combines time steps that are sufficiently close together, the number of time steps reported by this add-on may differ from the number of time steps reported by Tecplot 360 EX.

You can load this add-on by adding the following line to your Tecplot.add File.

$!LoadAddOn "tecutilscript_extendtimemcr"

Macro Processing

The Extend Time Macro add-on can be invoked from the macro language by using the following commands:

# These two lines retrieve the number of time steps. This number is represented here as the macro variable VVV.

$!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr' COMMAND='QUERY.NUMTIMESTEPS VVV'

# This line sets the solution time at time step nnn. The acceptable value range number for nnn is: 1 - NumTimeSteps.

$!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr' COMMAND='SET.CURTIMESTEP nnn'

# This line retrieves the solution time at time step nnn. This number is represented here as the macro variable VVV.

$!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr' COMMAND='QUERY.TIMEATSTEP nnn VVV'

The following is a sample loop that uses the Extend Time Macro add-on:

$!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr'

 COMMAND='QUERY.NUMTIMESTEPS NUMTIMESTEPS'

$!LOOP |NUMTIMESTEPS|

  $!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr'

    COMMAND='SET.CURTIMESTEP |LOOP|'

  $!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr'

    COMMAND='QUERY.TIMEATSTEP |LOOP| CURTIME'

  $!PAUSE "Current time is: |CURTIME|"

$!ENDLOOP

See also: Section 31 - 3.6 “Extract Over Time”, Section 31 - 3.12 “Solution Time and Strand Editor”. Section 31 - 3.4 “Extend Macro”, Section 31 - 3.14 “Time Series”, Section 7 - 2 “Time Aware”.