how to select solid to edit it

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

I'm new to TCL scripting, and I'm looking for a way to select a solid by its location.  I looked into *createmark with the 'by box'/'by cylinder' option, but they don't work for solids. 

 

'This is currently supported for nodes, elements, connectors, components (FE and connectors only), loads, equations, loadcols, systems, systcols, vectors, vectorcols, blocks, groups, sets and contactsurfs' - from Altair 14.0 documentation

 

I would also use the same method to find surfaces to edit solids. 

 

Can somebody help with this? 

 

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited February 2018

    I found another post that asked basically the same question (

     using hm_measureshortestdistance2 works, I just need to figure out how to call the entity_id that it returns.

     

    for example, I created a mark of all my solids *createmark solids 2 1-1000

     

    then I measured the distance between a node at (0 76 81) and all my solids with hm_measureshortestdistance2 0 76 81 solids 2 0 0

     

    I get the following:

    0 0 0 0 44 0 76 81

     

    my solid id is 44, but how do I extract it?

     

    Thank you

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited February 2018

    Hi

     

    You can get the solid id in the variable 'id' as following:

     set id [lindex [hm_measureshortestdistance2 0 76 81 solids 2 0 0] 4]

    or

     lassign [hm_measureshortestdistance2 0 76 81 solids 2 0 0] d dx dy dz id

    Hope it helps.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited February 2018

    Hi

     

    You can get the solid id in the variable 'id' as following:

      set id [lindex [hm_measureshortestdistance2 0 76 81 solids 2 0 0] 4]

    or

      lassign [hm_measureshortestdistance2 0 76 81 solids 2 0 0] d dx dy dz id

    Hope it helps.

     

    Thank you, akitoguc, that is cleaner code than what i had.  I had two extra lines to achieve the same thing.  

     

    I appreciate your time and help.