read result file using tcl

raj_20928
raj_20928 Altair Community Member
edited October 2020 in Community Q&A

Hi all,

I am new to tcl scripting

How can i read required data from .res file using tc lscripting

Thankyou in advance.

Answers

  • tinh
    tinh Altair Community Member
    edited February 2017

    Hi all,

    I am new to tcl scripting

    How can i read required data from .res file using tc lscripting

    Thankyou in advance.

     

     

    Dear,

    I think .res file is a binary file

    There is reference guide about how to read results using hmreslib.lib

    looking for it in Hypermesh Help

  • raj_20928
    raj_20928 Altair Community Member
    edited February 2017

    hi tinh,

    thank you for your response

    not only .res fie sir any other output  files like .out file or .op2 file

    is there any separate keyword for reading those.will it be available in reference guide

     

    regards

    raj 

     

  • tinh
    tinh Altair Community Member
    edited February 2017

    Hi,

    I am not sure whether it is listed in reference guide

    .out file seems to be a text file and you can parse it by tcl commands open, gets, ...

    but .op2, .res files contains structured data and you need to look for their format definition

    Alternative solution: open them in hyperview and use tcl to parse known data. There is reference guide about tcl classes used in hyperview

  • raj_20928
    raj_20928 Altair Community Member
    edited February 2017

    Hi tinh

    i will check in hyperwprks guide and get back to you.

    Thank you very much.

  • raj_20928
    raj_20928 Altair Community Member
    edited July 2019

    Hi tinh,

    My requirement is I want to get 5 first order nodes  of tetra elements for example (number will varies)nearest to the selected node.

    But using hm_getclosestnode I am getting one node only.. is there any way to do this.

    Please assist me to get solution.

    Thnks

  • tinh
    tinh Altair Community Member
    edited July 2019

    hi, add it to a mark to ignore in next search:

    Set closest1 [hm_getclosestnode x y z]

    *createmark nodes 1 $closest1

    Set closest2 [hm_getclosestnode x y z 0 1]

    *appendmark nodes 1 $closest2

    Set closest3 ....

    *appendmark...

  • raj_20928
    raj_20928 Altair Community Member
    edited July 2019

    Hi tinh,

    thank you for ur suggestion.

    While doing this it is considering 2nd order nodes also..but I want to ignore 2nd order node.(in tetra mesh)

    And while appending it considering selected node also as nearest node.

    thank you

  • tinh
    tinh Altair Community Member
    edited July 2019

    Ok . To ignore mid node, switch all elems to 1st order

    After found 5 nodes, switch elems to 2nd

  • raj_20928
    raj_20928 Altair Community Member
    edited July 2019

    Hi tinh,

    Thank you very much ..i got with this.

    I have a question ..reference I have is node number .with this node ..how to get a node in x direction on other side of component elements

    Other end distance may varies in x direction.i want to get a perpenduclar opposite node to the selected node on the component outer surface elements.

    Thank you.

     

  • tinh
    tinh Altair Community Member
    edited July 2019

    You can select nodes on a direction by 

    *createmark nodes 'on plane'

    Or 'by cylinder'