TCL code to select SURF/SET element edges
Hi all,
I'm trying to automate the SURF/SET element edge selection for a mesh refinement study. In the GUI, three steps are required as shown below:
This generates the following TCL code:
*createentity sets cardimage=SURF name="set1"
*addedgesorfaces sets id=1 reversenormal=1 "user_ids={5 1 6 2 }" "edge_indices={{3} {3} {3} {3} }"
*setvalue sets id=1 STATUS=2 3150=0
For a slightly finer mesh, only the second line is different;
*addedgesorfaces sets id=1 reversenormal=1 "user_ids={30 31 27 37 10 9 33 3 4 6 36 }" "edge_indices={{1} {1} {3} {1} {1} {1} {3} {1} {1} {3} {1} }"
My question:
How can I automate in TCL the selection of both "user_ids" and "edge_indices"? I tried to use line #7 (inner contour line) but this is where I am stuck. Attached is the model.
Find more posts tagged with
Thanks a lot for this partial solution!
I was able to combine the code from your screenshot with the element selection code found here:
https://community.altair.com/community?id=community_question&sys_id=4f56c8f61b2bd0908017dc61ec4bcb2a
With that, the complete solution is as follows:
*createmark nodes 2 "by lines" 7
*createmark elems 1 "by node" {*}[hm_getmark nodes 2]
*contactsurfcreatewithfaces "set_edges" 6 1 2 30.0 1 0
*setvalue sets id=1 cardimage="SURF"
*setvalue sets id=1 STATUS=2 3150=0
I appreciate your help!
hi,
I don't have an exact answer to your question but maybe you could use this command below.
With this one, you have to supply a mark of element selection, and then a mark of edge nodes selection.
Not exact, but you could create a mark with all your elements and for the nodes, you could use the 'edges' command to extract a component named '^edges' and then create a mark of nodes based on this component in order to give this to the below command.
*contactsurfcreatewithfaces
Creates a contact surface using 2D element edges or 2D/3D element faces.
Syntax
*contactsurfcreatewithfaces name color elem_mark_id node_mark_id break_angle reverse_normals on_face
Type
HyperMesh Tcl Modify Command
Description
Creates a contact surface using 2D element edges or 2D/3D element faces.
Inputs