How to create a TCL script for Isolating Element based on Element type in Hypermesh?

Saravanan R_20730
Saravanan R_20730 Altair Community Member
edited May 20 in Community Q&A

Hello,

I am new to TCL scripting. In HM workspace, the model is having different element types such as S3, S4, C3D4,C3D6,C3D10M and so on.

 I have planned to created script to isolate element based on element type (ex. C3D10M) as a practice session. But having no idea how to proceed further. Can someone help me

Regards,

SRV

Best Answer

  • SunnyZhang
    SunnyZhang
    Altair Employee
    edited May 17 Answer ✓

    Hi Saravanan, 

    To isolate C3D4 elements in your model, you can try these 3 lines of scripts: 

    hm_createmark elems 1 "equal to value" "typename C3D4"

    *createstringarray 2 "elements_on" "geometry_on"

    *isolateonlyentitybymark 1 1 2
    To isolate other type of elements, just replace the C3D4 in line 1 with the type desired.
     
    Regards, 
    Shaoyan

Answers

  • SunnyZhang
    SunnyZhang
    Altair Employee
    edited May 17 Answer ✓

    Hi Saravanan, 

    To isolate C3D4 elements in your model, you can try these 3 lines of scripts: 

    hm_createmark elems 1 "equal to value" "typename C3D4"

    *createstringarray 2 "elements_on" "geometry_on"

    *isolateonlyentitybymark 1 1 2
    To isolate other type of elements, just replace the C3D4 in line 1 with the type desired.
     
    Regards, 
    Shaoyan
  • Saravanan R_20730
    Saravanan R_20730 Altair Community Member
    edited May 17

    Thank you so much

  • SunnyZhang
    SunnyZhang
    Altair Employee
    edited May 20

    Thank you so much

    Welcome : )

  • Saravanan R_20730
    Saravanan R_20730 Altair Community Member
    edited May 20

    Hi Saravanan, 

    To isolate C3D4 elements in your model, you can try these 3 lines of scripts: 

    hm_createmark elems 1 "equal to value" "typename C3D4"

    *createstringarray 2 "elements_on" "geometry_on"

    *isolateonlyentitybymark 1 1 2
    To isolate other type of elements, just replace the C3D4 in line 1 with the type desired.
     
    Regards, 
    Shaoyan

    Also, is there any way to isolate different element type with above script?

     

  • Saravanan R_20730
    Saravanan R_20730 Altair Community Member
    edited May 20

    Also, is there any way to isolate different element type with above script?

     

    I mean, for example S3 and S4 element need to isolate at a time.