🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to get connected elements between components in hypermesh/hyperworks using "hm_getconnected2delems"?

User: "Christian Nörenberg"
Altair Community Member
Updated by Christian Nörenberg

Hi,

I want to connect 2 surfaces/components (2D) automaticly by using a contact (very low level question). Therefore I want to create 2 "contact surfaces" and use "contact pair".

1. Question: Is this even the right way? Or would it be enough to use 2 sets of "SET_ELEM" with the elements on the edge and pair them? Or 1 "SET_ELEM" and 1 "SET_GRID" with the nodes of the edge?

The elements and nodes between the components can be found by using the command "hm_getconnected2delems".
The Code I build so far for the first "contact surfaces" is:

*createentity sets cardimage=SURF name="set_1" id=1;   *createmark comps 1 "1" "2" *createstringarray 3 "find: 1 0 1 1" "features: 0 179.9 comp" "output: 0 1 1" set entity_list_all_comps [hm_getconnected2delems comps 1 1 3];    #as discribed in documentation set elem_list_comp_1 [lindex $entity_list_all_comps 0];            #elements from comp 1 set node_list_comp_1 [lindex $entity_list_all_comps 2];            #nodes from comp 1  eval *createmark elements 1 $elem_list_comp_1  eval *createmark nodes 1 $node_list_comp_1 *segmentsetaddfaces "set_1" 1 1 30 1 0

Same thing for the second "contact surface".
But somehow its not working. I think the lists are empty, but I cant see the elements in the list ("puts" isnt working)

image

Do you know how to use this command correctly?

Thanks for your answers!

Find more posts tagged with