🎉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

Sort by:
1 - 1 of 11
    User: "PaulAltair"
    Altair Employee
    Accepted Answer
    Updated by PaulAltair

    Thanks!

    But I think the first line is wrong bc "set_NODES" isnt created yet and the mark with nodes, too.
    Did you maybe miss some lines before?

    sorry, yes, copy/pasted wrong line

    ok, this is working:

    *createmark elems 1 displayed *equivalence elems 1 0.1 3 2 0 *createentity sets cardimage=SET_GRID includeid=0 name=set_NODES_LOW id=1 *setvalue sets name=set_NODES_LOW ids={[hm_getusermark nodes]} *equivalence elems 1 0.1 3 2 1 *createentity sets cardimage=SET_GRID includeid=0 name=set_NODES_HIGH id=2 *setvalue sets name=set_NODES_HIGH ids={[hm_getusermark nodes]} *createmark nodes 1 "by set id" 1 *findmark nodes 1 257 elements 0 2 *createentity sets cardimage=SET_ELEM includeid=0 name=set_ELEM_LOW id=3 *setvalue sets name=set_ELEM_LOW ids={[hm_getmark elems 2]} *createmark nodes 1 "by set id" 2 *findmark nodes 1 257 elements 0 2 *createentity sets cardimage=SET_ELEM includeid=0 name=set_ELEM_HIGH id=4 *setvalue sets name=set_ELEM_HIGH ids={[hm_getmark elems 2]} 

    only caveat is that it is sorting by 'High' and 'Low' Ids, so in cases where the numbering was crossing over between the comps, you would get a mixture of the elements from each component in each set