Get set ID by using name

Guy01
Guy01 Altair Community Member
edited October 2020 in Community Q&A

Hello

 

I am trying to get a set ID number by knowing its name.

Its not working (i have followed the user guide).

 

The commands i am using:

 

set set_name [hm_getstring 'Set Name=' 'Enter set name:'] -> here i am retrieving the set name by user input
tk_messageBox -message 'Id name: $set_name' 
set set_id [hm_getentityvalue sets $set_name id 0 -byname]
tk_messageBox -message 'Id num: $set_id' 
 

Thanks in advance

 

Tagged:

Answers

  • QuyNguyenDai
    QuyNguyenDai Altair Community Member
    edited February 2019

    When you have set name, you can get set ID by following command:

     set set_id [hm_getvalue sets name='E_1' dataname=id]

    When you have set ID, you can get set name by following command:

     set set_name [hm_getvalue sets id=2 dataname=name]

     

     

  • Guy01
    Guy01 Altair Community Member
    edited February 2019

    This works. Thanks a lot for the help.