Querying Assemblies and Components in Linux
Is it possible to query the list of assemblies and components in the terminal ?
I want to produce the output in terminal .
Answers
-
Before talking about Linux 'terminal', can you do the same within command area of Hypermesh?
0 -
Yeah it is .
*createmark comps 1 'all'
hm_getmark comps 1
This will produce the list of components present in the model right .
0 -
Write your TCL script (with above commands) and run it from command line.
0 -
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.
0 -
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
0 -
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()
0 -
Yes, you can find it in hm reference help (Ext API)
There is an example.
0 -
Altair Forum User said:
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,
0 -
Thank you @Q.Nguyen-Dai
0