Can someone help me translate this apdl code to pymapdl. I tried multiple things but it didnt work
component = 'CONTACT'
cmsel,,component !select Contact Faces acc. component
esln !select related Elements
ESEL,R,ENAME,,174 !Reselect all Contact Elements in Set
*GET,nelem,ELEM,,COUNT !count number of selected nodes on Faces
en=0 !initialize Elem Number to 0
*dim,elem_data,,nelem,2
*do,i,1,nelem !loop over nodes
en = ELNEXT(en) !next higher node number to nn
elem_data(i,1) = en !save node number to array
*GET, elem_data(i,2), ELEM,en,AREA
*enddo
*status,elem_data
Answers
-
Have you tried just calling this text as APDL input instead of converting it?
I would also suggest using PyDPF to extract the element area via this operator. You can get a skin mesh and get the areas of that skin in pythonop = dpf.operators.mesh.skin() # operator instantiation
op.inputs.mesh.connect(my_mesh)
op.inputs.mesh_scoping.connect(my_mesh_scoping)# optional
my_mesh = op.outputs.mesh()
my_nodes_mesh_scoping = op.outputs.nodes_mesh_scoping()
my_map_new_elements_to_old = op.outputs.map_new_elements_to_old()
my_property_field_new_elements_to_old = op.outputs.property_field_new_elements_to_old()0 -
@Shailesh Kumar : there are some limitations regarding the so called
Process Controls
you can follow this link for explanation.
for conversion of your APDL code please follow something similar to this
although you can do the above the recommended way is to use the pythonic way to convert your logic in python instead of APDL
0