My point of reference is for Nastran Bulks and OP2.
Situation For example if you have defined a Element set "set_cs" in the case control section in the master bulk with an ID =6.
Once the model and results are loaded in the HyperView, you'll see first 5 sets automatically created.
#Name Type ID
0D Set Components 1
1D Set Components 2
2D set Components 3
3D Set Components 4
Orphan Nodes Components 5
set_cs Elements 6
but if you try to create a new Element set in the HV GUI, it will create a Element set set_user with ID : 6
set_user Element 6
Task : To automate post-processing for results for multiple sets, subcases, result types etc.
Since sets are not unique by the ID. There can exist 2 sets sharing same ID of same element type.
if someone is trying to automate set selection based on SET ID of same type (element) to populate any linked property like Set Label.
Action : The pool Identifier has to be added on top of the ID while creating a handle for set.
hwi GetSessionHandle sess
sess GetProjectHandle prj
prj GetPageHandle pg [prj GetActivePage]
pg GetWindowHandle win [pg GetActiveWindow]
win GetClientHandle cliH
cliH GetModelHandle mod [cliH GetActiveModel]
set CaseControlSets [mod GetSelectionSetList SETS_ID_POOL]
foreach id $CaseControlSets{
set hN Cset${id}
mod GetSelectionSetHandle $hN "SETS_ID_POOL $id"
if {[$hN GetType] eq "element" && [$hN GetLabel] ne ""} {
puts "$id [$hN GetLabel] Cset"
}
$hN ReleaseHandle
}
set UserSets [mod GetSelectionSetList User_Set]
foreach id $UserSets {
set hN Uset${id}
mod GetSelectionSetHandle $hN "User_Set $id"
if {[$hN GetType] eq "element" && [$hN GetLabel] ne ""} {
puts "$id [$hN GetLabel] Uset"
}
$hN ReleaseHandle
}
Results : Correctly gives the labels based on ID and Pool Type, Now you can use this info for further manipulation.
Cheers