Toggle selection type to "Elements" from "Component"

Guy01
Guy01 Altair Community Member
edited October 2020 in Community Q&A

Hello

 

I am trying to code a custom vonMises stress result.

I am unable to change the selection type from component to elements (image below)

 

 

image.png.652916e4dea410ba6f195bed571c28f6.png

 

Below the code i used:

 

hwi GetSessionHandle sess
sess GetProjectHandle proj
proj GetPageHandle page1 [proj GetActivePage ]
page1 GetWindowHandle win1 [page1 GetActiveWindow]
win1 GetClientHandle po1
po1 GetModelHandle mo1 [po1 GetActiveModel ]
mo1 GetResultCtrlHandle res
res GetContourCtrlHandle contour_ctrl

contour_ctrl SetEnableState true
po1 SetDisplayOptions 'contour' true
po1 SetDisplayOptions 'legend' true

contour_ctrl SetDataType 'Stress'
contour_ctrl SetDataComponent node 'vonMises'
contour_ctrl SetShellLayer 'max'
contour_ctrl SetCornerDataEnabled true
contour_ctrl SetAverageMode 'Advanced'
contour_ctrl SetAvgAcrossPartsEnable true

 

I have spent hours of searching for changing the type of selection in console with APIs. Can anyone help?

 

Thanks in advance

Tagged:

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited March 2019

    Hi Roche,

     

    You will have to use selectionsets to show only the elements needed on the screen, then apply contour and get results from the contour. Search AddSelectionSet, SetSelectionSet, 

     model_handle AddSelectionSet type

    Examples using selectionset are already addressed in this forum.