Tcl for export session file .sés

Unknown
edited December 2023 in Community Q&A

Could you tell me the .tcl command to export a table in .ses format ( patran)?! 

i can't find it anywhere.  Thank you

Answers

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited March 2023

    I am not familiar with .ses format but , assuming you are exporting from HyperMesh, when you do it manually what commands show in the command_#.tcl file?

  • Unknown
    edited March 2023

    I am not familiar with .ses format but , assuming you are exporting from HyperMesh, when you do it manually what commands show in the command_#.tcl file?

    no one otherwise I didn't ask questions ????
  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited March 2023

    no one otherwise I didn't ask questions ????

    Please tell me the process you use to do it manually.

  • Unknown
    edited March 2023
    1) create Elm set

    2) tools -> set browser -> export set ( .session file )

    perhaps the right question was: how to export a table in “.ses” format with .Tcl commands

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited March 2023

    1) create Elm set

    2) tools -> set browser -> export set ( .session file )

    perhaps the right question was: how to export a table in “.ses” format with .Tcl commands

    Looks like it doesn't exist.  I will request it and see if there is a workaround.

  • Unknown
    edited March 2023
    the solution exists to export table in format separated by a symbol of your choice. it seems too strange to me that there is no solution for export in .ses Patran format. if you can find anything i am grateful
  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited March 2023

    the solution exists to export table in format separated by a symbol of your choice. it seems too strange to me that there is no solution for export in .ses Patran format. if you can find anything i am grateful

    There is a tcl command to export table?  Please share.

     

  • Unknown
    edited March 2023
    you find everything in other cases that I asked on the net.
  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited March 2023

    I have requested that a hm api be created to export a .ses file.  So, hopefully, in the future you will be able to do this with one command. Otherwise you can certainly write a file with tcl in whatever format you want.  It just may be a little tedious.  The basic commands will still be open, puts and close.  Each new puts would add another line to the file.  Something like this:

    *createmarkpanel sets 1
    set setList [hm_getmark sets 1]
    set fp [open $outFile w];
    puts $fp "\$# Started creation of session file $outFile at 10-Mar-23 14:03:05"
    puts $fp "\$# Exported by: Altair HyperMesh 2022.2.0.27"
    puts $fp "sys_poll_option( 2 )"
    foreach set $setList {
        set setName [hm_getvalue set id=$set dataname=name]
        puts $fp "ga_group_create( \"$setName\" )"
        puts $fp "ga_group_entity_add( \"$setName\", \" Element [hm_getvalue set id=$set dataname=elementids]\" )"
        puts $fp "sys_poll_option( 0 )"
    }
    puts $fp "\$# Stopped creation of session file exportSimple.ses at 10-Mar-23 14:12:33"
    close $fp

    You will need to set the outFile variable with the output file and if your set is very long will need to create line breaks but this is the basic idea.

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited March 2023

    The ExportToSession procedure in the default_component.tcl looks like it does what you want.
    It is in the installation directory \hwdesktop\hm\scripts\browser.

  • Michele Macchioni
    Michele Macchioni
    Altair Employee
    edited April 2023

    Hey Giovanni,

     

    just stumbling into this conversation and wondering what is missing from the HyperWorks package which leads you to the need of workign with Patran session file :)

    Let me know and hopefully we can provide a was better shortcut to your workflow.

    Ciao

    Michele

  • Jonny_CAP
    Jonny_CAP Altair Community Member
    edited December 2023

    Hey Giovanni,

     

    just stumbling into this conversation and wondering what is missing from the HyperWorks package which leads you to the need of workign with Patran session file :)

    Let me know and hopefully we can provide a was better shortcut to your workflow.

    Ciao

    Michele

    In my opinion, nothing is missing! Even if the versions up to 2019.1 are lacking in terms of extraction when compared to the simplicity ( only this ) of other famous competitors.

    The demand is the result of work necessities that still impose an old way of working based, pardon the repetition, on other software.