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

This issue is observed in 2021 and 2023
This works fine for 2022

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

  • Michael Herve
    Michael Herve
    Altair Employee

    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

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.