Get the max and min value of Aspect Ratio for a element set with TCL

Hideyoshi Santos
Hideyoshi Santos New Altair Community Member
edited December 2021 in Community Q&A

Hello everyone.

I'm checking the aspect ratio for a 2D mesh and trying to get the min and max values inside the set of elements selected.
This values ​​are made to be display in a tk_messageBox so is necessary to obtain this values ​​through TCL commands in the console/script.

Right now I'm only using the *elementtestaspect  witch give the elements that match the criteria in a mark and those that do not in another mark. With these I can only display the % of failure.

These is my code:

*createmark elements 1 "displayed"
*createmark elements 2
*elementtestaspect elements 1 20 2 2 0 " 2D Aspect Ratio"
set elements_OK [hm_marklength elements 1]
set elements_failed [hm_marklength elements 2]

tk_messageBox  -type ok -message "$elements_failed of $elements_OK  failed \n"

Hope you guys can help me.
Greetings!

Best Answer

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited December 2021 Answer ✓

    Something like this should give you what you want:
    hm_createmark elems 1 "advanced" "all"
    hm_getelemcheckbounds 1 2 aspect

Answers

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited December 2021 Answer ✓

    Something like this should give you what you want:
    hm_createmark elems 1 "advanced" "all"
    hm_getelemcheckbounds 1 2 aspect

  • Hideyoshi Santos
    Hideyoshi Santos New Altair Community Member
    edited December 2021

    That's just what I need it.
    Thanks so much, Ben!