calling tpl file in tcl script for using in hyperview

Aditya Palsule
Aditya Palsule New Altair Community Member
edited October 2020 in Community Q&A

I need to open a saved template say a.tpl as soon as i run a tcl file say x.tcl

 

basically i need to call tpl file in tcl file. How cn that be done?

Answers

  • tinh
    tinh Altair Community Member
    edited May 2017

    Hi,

    it is my lazy way to look for wrapping gui commands

    open a C:/sample.tpl file in hyperview:

     rename tk_getOpenFile tk_getOpenFile_Old proc tk_getOpenFile args {return C:/sample.tpl} hw::ExecuteMenuItem 188 .guiMainWindow.statusbar.bbox.bapply invoke .guiMainWindow.statusbar.bbox.bcancel invoke rename tk_getOpenFile '' rename tk_getOpenFile_Old tk_getOpenFile

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2017

    Hi,

    it is my lazy way to look for wrapping gui commands

    open a C:/sample.tpl file in hyperview:

      rename tk_getOpenFile tk_getOpenFile_Old proc tk_getOpenFile args {return C:/sample.tpl} hw::ExecuteMenuItem 188 .guiMainWindow.statusbar.bbox.bapply invoke .guiMainWindow.statusbar.bbox.bcancel invoke rename tk_getOpenFile '' rename tk_getOpenFile_Old tk_getOpenFile

     

    Hello tinh,

    Please can you help to get this tcl script to work on HW13.0

    Currently unable to run this on HW13.0.

    Currently using in .cmd file

    pushd C:\Program Files\Altair\13.0.110\hw\bin\win64
    start hw.exe -clientconfig hwplot.dat -tcl Z:\sample.tcl

     

    and in sample.tcl this data:

     

    rename tk_getOpenFile tk_getOpenFile_Old
    proc tk_getOpenFile args {return Z:/TowingTpl.tpl}
    hw::ExecuteMenuItem 188
    .guiMainWindow.statusbar.bbox.bapply invoke
    .guiMainWindow.statusbar.bbox.bcancel invoke
    rename tk_getOpenFile ''
    rename tk_getOpenFile_Old tk_getOpenFile

     

    Please can you able to make this work.

    Thanks

  • tinh
    tinh Altair Community Member
    edited July 2017

    Hi, 

    I am sorry that it did not work. I will check it and inform you.

    It may take a bit long time because I don't use hyperview much :ph34r:/emoticons/default_ph34r.png' srcset='/emoticons/ph34r@2x.png 2x' title=':ph34r:' width='20' />

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2017

    Hi, 

    I am sorry that it did not work. I will check it and inform you.

    It may take a bit long time because I don't use hyperview much :ph34r:/emoticons/default_ph34r.png' srcset='/emoticons/ph34r@2x.png 2x' title=':ph34r:' width='20' />

    Thank you tinh for your reply.

    No problem Tinh.

  • tinh
    tinh Altair Community Member
    edited July 2017

    Hi @Pradeep

    I found it, 

    You have to use an HW Desktop class named 'hwIReportTemplate'

    Looking for its usage in Reference Guide>Hyperworks Desktop,

    You have to set parameter pointing to your *.tpl file then invoke hwIReportTemplateApply method