Querying Assemblies and Components in Linux

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

Is it possible to query the list of assemblies and components in the terminal ?

I want to produce the output in terminal . 

Answers

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited February 2020

    Before talking about Linux 'terminal', can you do the same within command area of Hypermesh?

     

  • Anirudh12
    Anirudh12 New Altair Community Member
    edited March 2020

    Yeah it is . 

    *createmark comps 1 'all'

    hm_getmark comps 1

     

    This will produce the list of components present in the model right .

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited March 2020

    Write your TCL script (with above commands) and run it from command line.

  • Anirudh12
    Anirudh12 New Altair Community Member
    edited March 2020

    So how does it identify the model present in the hm  session ?

    Should i specify the model name or session name along with tcl script while running it from command line.

  • tinh
    tinh Altair Community Member
    edited March 2020

    I think hm cannot return complist to console, hm (and executables) will return an exit code (integer).

    If you want to get complist, use tcl to get and write it to a text file and then read the file in console

  • Anirudh12
    Anirudh12 New Altair Community Member
    edited March 2020

    thanks a lot .Also is there a way to access the hm apis through terminal / use hm apis through any programming language using HM_EXTAPI()

  • tinh
    tinh Altair Community Member
    edited March 2020

    Yes, you can find it in hm reference help (Ext API)

    There is an example.

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited March 2020

    Yeah it is . 

    *createmark comps 1 'all'

    hm_getmark comps 1

     

    This will produce the list of components present in the model right .

     

    Here's my test to get ID list of all comps:

     > ./cmd2.sh  21 22 23 24 31 32 33 34 35 36 37 38 3 4 1 2 5 39 42 44 46 47

    File cmd2.sh:

     #!/bin/bash HM='/opt/hw/2019.1/altair/scripts/hm' OPTS='-nocommand -nouserprofiledialog -batch -nobg' TCL='-tcl test2.tcl' export ALTAIR_LICENSE_PATH='6200@YOUR-LICENSE-SERVER' $HM $OPTS $TCL 2>/dev/null

    FIle test2.tcl:

     *templatefileset '/opt/hw/2019.1/altair/templates/feoutput/nastran/general' *readfile '/FULL/PATH/samcef_validation_hw2019.hm' *createmark comps 1 'all' set comp_list [hm_getmark comps 1] puts '$comp_list'

    HTH,

     

     

  • Anirudh12
    Anirudh12 New Altair Community Member
    edited March 2020

    Thank you @Q.Nguyen-Dai