Starting a Solver automatically

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hey guys,

 

is it somehow possible to start and execute an OptiStruct Solver Run automatically by a .tcl command or script?

The aim of this is to create the .h3d-File and .res-File automatically without pressing any buttons.

 

I'm working with the 2017.2 student version of HyperWorks.

 

Kind regards and thanks in advance,

Simon

Answers

  • tinh
    tinh Altair Community Member
    edited December 2018

    I answered this in a certain topic. Please search it first

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited December 2018

    Hey tinh,

     

    I've checked the other topic, but an error is still occuring.

     

    This is the part of my code where I'm trying to run the simulation:

    *createstringarray 1 'CONNECTORS_SKIP '
    hm_answernext yes
    *feoutputwithdata 'C:/Program Files/Altair/2017.2-edu/templates/feoutput/optistruct/optistruct' 'C:/Users/Simon/Desktop/CAO/test.fem' 1 0 2 1 1
    exec 'C:/Program Files /Altair/2017.2-edu/hwsolvers/scripts/optistruct.bat' 'C:/Users/Simon/Desktop/CAO/test.fem' -analysis
    *writeh3dwithoptions 'C:/Users/Simon/Desktop/CAO/test.h3d' 1 4

     

    The test.fem is written and saved into the desired folder, but an error is occuring in the next line.

    Error_1.PNG.8183b7098c30754f0a2f9241f599185d.PNG

    Could you help me out there? I'm using Windows 10.

     

    Besides, I'm aiming for writing a .res-file. Do you know how this works?

     

    Kind regards and thanks in advance,

    Simon

     

  • tinh
    tinh Altair Community Member
    edited December 2018

    I don't have education version.

    Try searching file optistruct.bat by window search box

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited December 2018

    I know where it is located and I'm pretty sure to have chosen the right path.

    Any other idea why it doesnt work?

  • tinh
    tinh Altair Community Member
    edited December 2018

    I don't believe you

    Sure I believe computer, because the error says 'no such file or directory', obviously

     

    Try again and again

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited December 2018

    As you can see on the screenshot, this is the path indicated by windows.

    Path_OptiStruct.png.d20473a13dad7e99911fac1f61d9bcca.png

    I improved my code to:

    *createstringarray 1 'CONNECTORS_SKIP '
    hm_answernext yes
    *feoutputwithdata 'C:/Program Files/Altair/2017.2-edu/templates/feoutput/optistruct/optistruct' 'C:/Users/Simon/Desktop/CAO/test.fem' 1 0 2 1 1
    'C:/Program Files /Altair/2017.2-edu/hwsolvers/scripts/optistruct.bat' 'C:/Users/Simon/Desktop/CAO/test.fem' -analysis

     

    Now an error is occuring saying that the last line is an invalid command name.

     

     

  • tinh
    tinh Altair Community Member
    edited December 2018

    Certainly, it needs exec command

     

    The file optistruct.bat is existing

    That means the path you typed in is wrong

    Please check it.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited December 2018

    Hey tinh,

     

    it finally worked out. Thanks for your patience and help.

     

    Simon