How to automate implimentation of session templates?

Richard Smith
Richard Smith Altair Community Member
edited March 2023 in Community Q&A

In HyperWorks I create a session that has a number of windows which maybe Hyperview and HyperGraph windows.

I setup my post processing session for a single solution load case (in my example from LS_Dyna) and then save the session as a template.

I want to run this template to generate exactly the same post session for a number (or many) of the same model undergoing a different load case.

I can do this through the flexible reports interface no issue, however I have to do this independently for each of my load cases (i.e. fill out the paths for graphics file, results file and plot file) which is tedious. I want to automate this across any number of load cases without having to manually fill in the paths.

I believe this is possible to automate using TCL and HWC scripting which I have been playing with, but have not yet managed to get to work.

I found the following video on Altair How-To Youtube which appears to do essentially exactly what I need to do, however unlike the HyperGraph only example shown, I also want to build my HyperView windows as well.

https://www.youtube.com/watch?v=uMeBNfEeIAk&list=FLvTNzGdQA65jXsoO8SAaASA&index=1&t=46s

Using the script shown in that video and modifying it for my session, I generated this tcl script which does not work (in my case I have 5 directories each with a solution set in them)?

set ApproachDir [tk_chooseDirectory]
cd $ApproachDir
set RunDirList [glob -types d *]
foreach RunDir $RunDirList {
    hwc open parameterizedsession add "C:/Working Folder/Template.tpl"
    hwc open parameterizedsession append Template GRAPHIC_FILE_1=$RunDir/Bracket.k RESULT_FILE_1=$RunDir/d3plot PLOT_FILE_1=$RunDir/binout0000
}

What am I doing wrong?

Any help would be greatly appreciated.

Thanks.

Richard.

 

 

 

Answers

  • Adriano_Koga
    Adriano_Koga
    Altair Employee
    edited January 2023

    maybe 2 things:

    "C:/Working Folder/Template.tpl" >> avoid the 'space' in your directory.

     

    the ohter thing is that:

    hwc open parameterizedsession append Template GRAPHIC_FILE_1=$RunDir/Bracket.k RESULT_FILE_1=$RunDir/d3plot

     

    $RunDir has only the directory name.

    Maybe you should add ./ before (just guessing, need to test it) >>  ./$(RunDir)/Bracket.k

  • Richard Smith
    Richard Smith Altair Community Member
    edited March 2023

    Hi Adriano, thanks for the reply.

    I tried your changes as such:

    cd $ApproachDir
    set RunDirList [glob -types d *]
    foreach RunDir $RunDirList {
        hwc open parameterizedsession add "F:/PROJECT_FOLDER/Bracket/Template.tpl"
        hwc open parameterizedsession append Template GRAPHIC_FILE_1=./$RunDir/Bracket.k RESULT_FILE_1=./$RunDir/d3plot PLOT_FILE_1=./$RunDir/binout0000
    }

    The dialogue box appears and i select the parent directory with the sub directories in it.

    However then it simply notes "Loading Report" down the left side info bar but nothing happens?

    I've waited forever too, even though it's saying "Loading Report" nothing happens??

    Frustrating...

    Thanks.