Offset solutiontime

Moderators: steve, jprenaud, straton, Chris Idso, davetaflin, salter

zonexo
Experienced user
Posts: 47
Joined: Mon Feb 11, 2008 8:57 pm
Location: Singapore
Contact:

Offset solutiontime

Postby zonexo » Mon Feb 18, 2013 4:24 am

Hi,

Is it possible to offset the solutiontime?

For e.g., if my solutiontime for the animation goes from 8.4 to 10.4,

is it possible to offset it by 8.4 such that it starts from 0 to 2.0?

Hence when I run my animation using &(solutiontime) or a new variable, it can show from 0 to 2.0 in my animation.

thank you!

RobY
Newbie
Posts: 2
Joined: Tue Apr 09, 2013 12:31 pm
Location: Ottawa

Re: Offset solutiontime

Postby RobY » Thu Apr 11, 2013 7:48 am

I had this problem too. If the time difference between each zone is constant you can do it with the Edit Time Strands dialog but if not, its not as easy.. I couldn't figure out how to do it with the GUI or even with a macro but managed to do it with a python script:

Code: Select all

import TecUtil
import TecVals

def TP_offset_sol_time(offset):
    for znum in range(1,TecUtil.DataSetGetNumZones()+1):
        soltime = TecUtil.ZoneGetSolutionTime(znum)
        soltime = soltime + offset
        TecUtil.ZoneSetSolutionTime(znum,soltime)
    return 0

zonexo
Experienced user
Posts: 47
Joined: Mon Feb 11, 2008 8:57 pm
Location: Singapore
Contact:

Re: Offset solutiontime

Postby zonexo » Thu Apr 25, 2013 10:09 pm

Thanks RobY!

I'm not familiar with python but I'll save it 1st and look into it.

RobY
Newbie
Posts: 2
Joined: Tue Apr 09, 2013 12:31 pm
Location: Ottawa

Re: Offset solutiontime

Postby RobY » Fri Apr 26, 2013 5:59 am

Support pointed out this addon to me:

http://www.tecplottalk.com/addons/ExtendTimeMcr/

Using these commands you can offset solution time with a macro.

Code: Select all

# Determines how many time steps are in the Strand
$!ADDONCOMMAND ADDONID='Extend Time MCR'
  COMMAND='QUERY.NUMTIMESTEPS NumTimeSteps'

# Begins loop over number of time steps
$!LOOP |NumTimeSteps|
  # Gets time at the current step
  $!ADDONCOMMAND ADDONID='Extend Time MCR'
    COMMAND='QUERY.TIMEATSTEP |LOOP| CurTime'
  #Changes time by constant amount
  $!VarSet |CurTime| -= 50
  #Assigns the new Time Value to the Time Step
  $!EXTENDEDCOMMAND
    COMMANDPROCESSORID = 'Strand Editor'
    COMMAND = 'ZoneSet=|LOOP|;AssignSolutionTime=TRUE;TimeValue=|CurTime|;TimeOption=SingleValue;'
$!ENDLOOP


Return to “Tecplot 360 and Focus”

Who is online

Users browsing this forum: No registered users and 0 guests