How to check element type using TCL commands
Dear all,
Could you tell me how can I obtain ANSYS element type in HyperMesh using TCL commands?
My target is to put element type name into a variable.
The procedure using graphical interface is following: 2D/3D -> element types -> mark element -> review. (result on the figure)
Is it possible to extract such information from particular element by a TCL command?
I've tried by hm_getentityvalue but got stuck on data_name format.
Best regards
Jakub
Answers
-
Try this code:
*createmarkpanel elems 1 'Select Elems' set elems [hm_getmark elems 1] *clearmark elems 1 foreach eid $elems { set typename [hm_getentityvalue elems $eid typename 1] puts [format 'Eid %6d ; Typename= %s' $eid $typename] }
HTH,
1 -
Altair Forum User said:
Try this code:
*createmarkpanel elems 1 'Select Elems' set elems [hm_getmark elems 1] *clearmark elems 1 foreach eid $elems { set typename [hm_getentityvalue elems $eid typename 1] puts [format 'Eid %6d ; Typename= %s' $eid $typename] }
HTH,
Looks like this still works in HyperMesh 2021.2 but it is not listed in the Tcl Query Commands reference page, which I assume means it won't work very soon. Does anyone know the current way to do this command in HyperMesh 2021?
Found it:
Use hm_getvalue.
Example: Find the type of the element with id=9298, which in my model is a CQUAD4 element for NASTRAN:
set elem_id 9298;
set elem_type_name [hm_getvalue elems id=$elem_id dataname=typename]; # Returns: CQUAD4
set elem_type_id [hm_getvalue elems id=$elem_id dataname=type]; # Returns: 1I'm not sure how that 1 in the last command corresponds to the values found using the ``
hm_getentityvalue elems $elem_id typename 1`` command....
See also: elements data name for HM20210