TCL script files parameters

inasiopo
inasiopo New Altair Community Member
edited October 2020 in Community Q&A

Dear all,

 

We are trying to create a tcl script that is called from a batch file with:

 

C:\....\hmbatch.exe -tcl C:\...\MyTcl.tcl

 

That works fine.

 

Our TCL then looks like:

 

variable myLocation [file normalize [info script]]
append filename1 $myLocation 'Tester02.fem'
append filename2 $myLocation 'Tester02.sh'


*createstringarray 2 'isosurf: 3 3 0.6 0 -1 0 0 10 30 1 0' 'other_params: 1 0 0 0 10 0'
*ossmooth_12 0 1 0 1 '$filename1' '$filename2' '*.grid' 1 0 1 2

 

 

but this is not working. Apparently when trying to run the *ossmooth' command the '$filename1' and '$filename2' variables are not recognised.

 

Any help on how we can do that please??

 

 

Tagged:

Answers

  • QuyNguyenDai
    QuyNguyenDai Altair Community Member
    edited November 2017

    *createstringarray 2 'isosurf: 3 3 0.6 0 -1 0 0 10 30 1 0' 'other_params: 1 0 0 0 10 0'
    *ossmooth_12 0 1 0 1 '$filename1' '$filename2' '*.grid' 1 0 1 2

     

    So try:

     *createstringarray 2 'isosurf: 3 3 0.6 0 -1 0 0 10 30 1 0' 'other_params: 1 0 0 0 10 0' eval *ossmooth_12 0 1 0 1 '$filename1' '$filename2' '*.grid' 1 0 1 2

     

  • inasiopo
    inasiopo New Altair Community Member
    edited November 2017

    tried it! Still not working!

    It seems it still does not recognise the two path variables.

     

    Any help please?

  • QuyNguyenDai
    QuyNguyenDai Altair Community Member
    edited November 2017

    After the 2nd 'append' command, print out values of these variables for checking.

     

  • inasiopo
    inasiopo New Altair Community Member
    edited November 2017

    I had a problem there.

    But that is sorted now!

     

    Now it exports the two variables as:

     

    C:/Users/user1/Desktop/Gen/Tester02.fem
    C:/Users/user1/Desktop/Gen/Tester02.sh

     

    wihich is the correct path and has the files inside.

     

    Still not running though! It says:

     

    'Error: Invalid input model'

    0

    'ossmooth_12 0 1 0 1 C:/Users/user1/Desktop/Gen/Tester02.fem C:/Users/user1/Desktop/Gen/Tester02.sh *.grid 1 0 1 2'

    <'eval' body line 1>

    invoked from within

    .........

     

    Please help !!!!!

  • inasiopo
    inasiopo New Altair Community Member
    edited November 2017

    Foud it!!!

     

    There was an error in the actual fem file and it wouldn't let it run.

    Now fixed it and with all changes you suggested it works!!

     

    Many thanks!