Contact surface definition using TCL

Wesley Peijnenburg
Wesley Peijnenburg Altair Community Member
edited October 2023 in Community Q&A

In Hyperworks this is relatively easy using model > contacts > surface and then selecting the elements by surface as shown in below screenshot:

image

 

Then, the command file shows the specific id's 
*addedgesorfaces sets id=1 reversenormal=1 "user_ids={553 725 1204 466 1073 463 491 619 1135 525 1077 668 418 1134 515 451 564 597 562 1226 424 669 726 1175 619 1217 677 1157 451 667 769 553 725 466 1151 460 447 427 1156 1139 505 1145 726 528 405 625 462 653 624 630 552 1149 974 540 505 482 1196 652 558 433 447 404 597 1150 521 669 654 463 1054 613 701 1213 482 523 515 1147 625 552 624 562 1176 }" "face_indices={{0} {1} {0} {1} {2} {1} {0} {3} {0} {2} {2} {0} {2} {0} {1} {3} {2} {1} {1} {0} {0} {1} {3} {0} {1} {0} {3} {0} {1} {0} {0} {1} {2} {2} {0} {0} {1} {0} {0} {0} {0} {0} {1} {1} {2} {2} {0} {0} {1} {0} {0} {0} {2} {2} {3} {3} {0} {0} {0} {0} {0} {2} {0} {0} {1} {0} {0} {3} {0} {0} {2} {0} {1} {2} {3} {0} {3} {1} {2} {3} {0} }"

 

However, for a mesh refinement study I need these ID's to be identified automatically. Is there a convenient way? 

 

Following the documentation, there seems to be a way but I am getting stuck using the below code. 
*createmark nodes 2 "by box" -99 -99 0 99 99 0 0 inside 0 0 0.001
*createmark elems 1 "by node" {*}[hm_getmark nodes 2] 
*contactsurfcreatewithfacesusingfacenumber "segment_set_model" 32 1 1 reverse_normals=1 ?element_id? ?use_element_id?

 

Any suggestions? The simple cube model is attached.