Error in accessing card image of material in batchmode

Akash Purushothaman
Akash Purushothaman Altair Community Member

I have a script which tries to fetch the card image of the materials.
I am trying to filter the materials with card image type "MATERIAL"
In order to achieve this, I am using

hm_getvalue mats id=$mat_id dataname=cardimage

hm_getvalue mats id=$mat_id dataname=solverkeyword

These command works fine when I use in GUI mode.
But when I run the same command in batch mode this command returns
<None> for cardimage and empty string ("") for solverkeyword

The batch command that I use to call the script is as follows
start /min /wait "Script" "path/to/hw.exe" /clientconfig hwfepre.dat -b -tcl "path/to/script.tcl" -wait

I need help to rectify this issue as executing via batch mode is the necessity

I hereby attach the tcl file for your reference

Thanks & Regards
Akash P

Answers

  • hello @Akash Purushothaman ,

    $this could be linked to the model file import not being completed in hmbatch before running the command. I faced some similar behavior in the past, to double check it you may ask a pause/sleep in your script.

    So basically replace line40 set allmats [hm_entitylist mats id]

    by

    after 50000 set allmats [hm_entitylist mats id]

    Hope that helps,

    Michael

  • Akash Purushothaman
    Akash Purushothaman Altair Community Member

    Hi Micheal,

    I tried this workaround, but still does not work.

    I used version 2023.1
    Does it have to do anything with the unity version?
    Is there a chance that it might be because I still use

    Path/to/hw.exe /clientconfig hwfepre.dat -b -tcl path/to/mat_extract.tcl

    Best Regards,

    Akash P

  • Hello @Akash Purushothaman ,

    this is indeed a reason. After 2022.3, we de-activated hwepre client with hw executable, in order to deprecate Classic interface. If you need to run in batch mode, please try the binary hmbatch.exe.

    Otherwise, we can run batch mode for tcl and Python commands from 2024.1, and the reading of arguments in command line will be simplified with 2025 version, to be released soon.

    Best Regards,

    Michael

  • Akash Purushothaman
    Akash Purushothaman Altair Community Member

    Hello @Michael Herve_21439,

    Thanks for the explanation.
    For the lower versions, I used

    HyperView - Path/to/hw.exe /clientconfig hwpost.dat

    HyperMesh - Path/to/hw.exe /clientconfig hwfepre.dat

    Now that the classic versions are not available, may I know what should be the batch commands that can be used to replace these above commands to execute Hypermesh and HyperView?