How to query element property in HM?

Artem
Artem New Altair Community Member
edited May 2022 in Community Q&A

Hi

I'm trying to get the property ID (PSHELL ID) from the manually selected elements and write it to *.txt file. Can anyone suggest a command? I did not find a suitable one in the help.

Tagged:

Answers

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited May 2022

    Matrix Browser seems like a good option for doing this.

    The following may help:

    https://community.altair.com/community?id=kb_article&sys_id=eec0d22e1b6ad0108017dc61ec4bcb9c

  • tinh
    tinh Altair Community Member
    edited May 2022
    hi there are several ways... pick your concerned elems: *createmarkpanel elems 1 "pick it!" get the elems ids set eids [hm_getmark elems 1] get there pid: foreach eid $eids { set pid [hm_getentityvalue elems $eid component.property.id 0] #maybe pshell id is different, as it is a solver attribute: set psid [hm_getsolverid props $pid] puts "eid=$eid psid=$psid" }
  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited May 2022
    tinh said:

    hi there are several ways... pick your concerned elems: *createmarkpanel elems 1 "pick it!" get the elems ids set eids [hm_getmark elems 1] get there pid: foreach eid $eids { set pid [hm_getentityvalue elems $eid component.property.id 0] #maybe pshell id is different, as it is a solver attribute: set psid [hm_getsolverid props $pid] puts "eid=$eid psid=$psid" }

    Yes!  This would be the scripting approach.  I would suggest using hm_getvalue rather than hm_getentityvalue though.

    hm_getvalue elem id=$eid dataname=propertyid

    https://2022.help.altair.com/2022/hwdesktop/hwd/topics/reference/hm/hm_getvalue.htm