hm_highlightmark elems is not working in HM 2019.

Hypermesh User
Hypermesh User Altair Community Member
edited January 2021 in Community Q&A

Hi,

    hm_highlightmark elems is not working in HM 2019.

Actually, I want to save a elems mark to variable and pass the variable to proc and want to highlight the elements in the selected mark.

But I won't see any elems being highlighted.

 

 

 

 

proc highlightelems { args } {

hm_createmark elems 2 $args
hm_highlightmark elems 2 "h" 0

}

*createmarkpanel elems 1 "Select the elements"
set elmestotest [hm_getmark elems 2]
::highlightelems $elmestotest

Best Answer

  • Julien Comas_21483
    Julien Comas_21483
    Altair Employee
    edited January 2021 Answer ✓

    Hello,

     

    I think your problem is not related to the API hm_highlightmark but because your element's marks are not consitent.

    with createmarkpanel, you use mark id 1 but you try to retrieve the selection of mark id 2.

    Please try this code:

    proc highlightelems { args } {

    hm_createmark elems 2 $args
    hm_highlightmark elems 2 "h" 0

    }

    *createmarkpanel elems 1 "Select the elements"
    set elmestotest [hm_getmark elems 1]
    ::highlightelems $elmestotest

     

    Thanks and Regards

    Julien

Answers

  • Julien Comas_21483
    Julien Comas_21483
    Altair Employee
    edited January 2021 Answer ✓

    Hello,

     

    I think your problem is not related to the API hm_highlightmark but because your element's marks are not consitent.

    with createmarkpanel, you use mark id 1 but you try to retrieve the selection of mark id 2.

    Please try this code:

    proc highlightelems { args } {

    hm_createmark elems 2 $args
    hm_highlightmark elems 2 "h" 0

    }

    *createmarkpanel elems 1 "Select the elements"
    set elmestotest [hm_getmark elems 1]
    ::highlightelems $elmestotest

     

    Thanks and Regards

    Julien