Hi all. I was trying to plot the signed von-mises stress contour for a component named "2D" with ID 4. I did it using the hwc commands in hyperview 2021 but those commands do not work in the 2019 version. With some help online, I wrote the following code:
hwi OpenStack;
hwi GetSessionHandle ses_h;
ses_h GetProjectHandle pro_h;
pro_h GetPageHandle pg_h [pro_h GetActivePage];
pg_h GetWindowHandle win_h [pg_h GetActiveWindow];
win_h GetClientHandle cli_h;
i
cli_h AddModel $fileName
cli_h GetModelHandle mod_h [cli_h GetActiveModel];
mod_h SetResult $fileName
# isolating 2D component
set id1 [mod_h AddSelectionSet element];
mod_h GetSelectionSetHandle sel_s_h_e $id1;
sel_s_h_e Add "component 4"; # component 2D has ID 4
sel_s_h_e Reverse;
mod_h Mask $id1;
sel_s_h_e ReleaseHandle;
# setting the result
mod_h GetResultCtrlHandle res_h;
res_h GetContourCtrlHandle cont_h;
cont_h SetEnableState true;
cli_h SetDisplayOptions "contour" true;
cont_h SetDataType "Element Stresses";
cont_h SetShellLayer "max";
cont_h SetDimensionEnabled shell true
cont_h SetDataComponent shell "2D";
#cont_h SetDataComponent "SignedVonMises";
cont_h SetAverageMode "simple";
cli_h Draw; # draw the contour
_________________________________________
The above script does not seem to work as no contours are plotted. Also, how may I include "signed von Mises" results in this script? Please help me correct this script.
Also, is there any way to run hwc commands in version 2019 and lower?
Regards,
Rachit