TCL script for automating Quality check

Saravanan R_20730
Saravanan R_20730 Altair Community Member
edited August 13 in Community Q&A

I am new to TCL scripts. I am planning to write a script for a dialog box that automates 3D Quality parameter checks.

When the quality parameter is checked in the dialog box, the result should be shown as either PASS or FAIL for component wise as shown below.

Example :                                                                                                                                                                                                                         

Component name  Warpage     Jacobian Skew
Bush    PASS  FAIL  PASS 
  Bolt    FAIL PASS PASS 

      

Can anyone help me on this !!!

 

 

Answers

  • Michael Herve_21439
    Michael Herve_21439
    Altair Employee
    edited August 13

    Hello @Saravanan R ,

    such automation is quite a project and is challenging for anyone starting with tcl automation (or Python automation, which I would recommend from version 2024).

    For beginners, we generally recommend to start simple ;)

     

    That said, this project requires several steps:

     

    1) a GUI to check the criteria of interests. Why not, but itlooks to me like an optional step which you could keep for the end of your project. If you want to explore this approach and that you have access (meaning your company/university does not block them), use ChatGPT/Copilot/... like tools to draft your GUI code, then tune it

    2) query of element quality. That will require marks with tcl (or collections with Python), and element datanames (https://help.altair.com/hwdesktop/hwd/topics/reference/hm/data_names-elements-hex8_r.htm)

    in tcl, for a selection of hexa elements, that will look like:

    set WarpageThreshold 1
    set MinAngleThreshold 75

    *createmark elems 1 "by config" 208

    set WarpageList [hm_getvalue elems mark=1 dataname=warpage]
    set WarpageMax [lindex [lsort -real $WarpageList] end]

    set MinAngleList [hm_getvalue elems mark=1 dataname=minangle]
    set MinAngleMin [lindex [lsort -real $MinAngleList] 0]


    if {$WarpageMax <= $WarpageThreshold} {
        set WarpageStatus pass
    } else {
        set WarpageStatus fail
    }

    if {$MinAngleMin >= $MinAngleThreshold} {
        set WarpageStatus pass
    } else {
        set WarpageStatus fail
    }

    In the example above, you need to add a loop over your components to get closer to your expected outputs, and to extend the code (add all checks of interest, and all solid configs of interest)

     

    3) a way to print the results
    It could be as a table in HyperMesh (*tablecreate), or by populating a TableView client, or by outputing the results in an ASCII or html format. 
    Simplest method here is ACII output, and as for point 1 feel free to draft your code with llm if possible

     

    Hope that helps,
    Michael