Old example below, something may not work but at least it should give you idea how to play with it
(do not use Kernel in your code ; just example)
Public Sub CodeCombinations(ByVal ccE As RobotOM.RobotCodeCombinationEngine, ByVal k As KernelOM.RobotKernel)
Dim KccE As KernelOM.RobotCodeCombinationEngine
KccE = k.Structure.Cases.CodeCmbEngine
'Dim ccG As RobotOM.RobotCodeCmbGroup
'Dim KccG As KernelOM.RobotCodeCmbGroup
Dim cas_lst As String = ""
Const COMB_TYPES As Integer = 7
'Const COMB_GROUPS As Integer = 6
Const COMB_DECID_VAL As Integer = 14
'Const COEF_COUNT As Integer = 13
Dim i As Integer
'Dim j As Integer
Dim q As Integer
KccE.Params.GenType = ccE.Params.GenType
'cases
Dim casCol As RobotOM.IRobotCollection
Dim KcasCol As KernelOM.IRobotCollection
casCol = ccE.Params.ActiveCases
KcasCol = KccE.Params.ActiveCases
Dim cinfo As RobotOM.RobotCodeCmbActiveCaseInfo
Dim Kcinfo As KernelOM.RobotCodeCmbActiveCaseInfo
For i = 1 To KcasCol.Count
Kcinfo = KcasCol.Get(i)
For q = 1 To casCol.Count
cinfo = casCol.Get(q)
If cinfo.CaseNumber = Kcinfo.CaseNumber Then
Exit For
End If
Next
If cinfo.IsSelected Then
Kcinfo = KcasCol.Get(i)
Kcinfo.IsSelected = cinfo.IsSelected
Kcinfo.Coefficient = cinfo.Coefficient
End If
Next
If ccE.Params.AllBars Then
KccE.Params.AllBars = ccE.Params.AllBars
Else
KccE.Params.BarSel = ccE.Params.BarSel
End If
If ccE.Params.AllNodes Then
KccE.Params.AllNodes = ccE.Params.AllNodes
Else
KccE.Params.NodeSel = ccE.Params.NodeSel
End If
KccE.Params.ExtremalSnowFactor = ccE.Params.ExtremalSnowFactor
If KccE.Params.GenType = KernelOM.IRobotCodeCmbGenerationType.I_CCGT_SIMPLIFIED Then
For i = 1 To COMB_DECID_VAL
KccE.Params.SelectDecidingValue(i, ccE.Params.IsDecidingValueSelected(i))
Next
KccE.Params.SelectDecidingValue(KernelOM.IRobotCodeCmbDecidingValueType.I_CCDVT_REACTIONS, _
ccE.Params.IsDecidingValueSelected(RobotOM.IRobotCodeCmbDecidingValueType.I_CCDVT_REACTIONS))
End If
'For q = 1 To ccE.Params.Regulations.Actions.Count
' KccE.Params.Regulations.Actions.SetNature(q, ccE.Params.Regulations.Actions.GetNature(q))
' KccE.Params.Regulations.Actions.SetName(q, ccE.Params.Regulations.Actions.GetName(q))
' For j = 0 To COEF_COUNT
' KccE.Params.Regulations.Actions.SetCoeff(q, j, ccE.Params.Regulations.Actions.GetCoeff(q, j))
' Next
'Next
'Dim lim_state As RobotOM.IRobotLimitState
'Dim cmb_typ As RobotOM.IRobotCodeCmbCombType
'Dim cmb_nam As String = ""
'Dim d_c As Short, l_c As Short, a_c As Short, s_c As Short
'For i = 1 To ccE.Params.Regulations.Combinations.Count
' ccE.Params.Regulations.Combinations.Get(i, lim_state, cmb_typ, cmb_nam, d_c, l_c, a_c, s_c)
' KccE.Params.Regulations.Combinations.[New](lim_state, cmb_typ, cmb_nam, d_c, l_c, a_c, s_c)
'Next
'Try
' q = 0
' While True
' KccE.Params.SelectCombination(q, ccE.Params.IsCombinationSelected(q))
' q += 1
' End While
'Catch ex As Exception
' 'end of combinations
'End Try
'combinations
For i = 0 To COMB_TYPES
If ccE.Params.IsCombinationTypeSelected(i) Then
KccE.Params.SelectCombinationType(i, True)
Else
KccE.Params.SelectCombinationType(i, False)
End If
Next
'groups
'For i = 0 To COMB_GROUPS
' For j = 0 To ccE.Params.Groups.GetCount(i)
' ccG = ccE.Params.Groups.Get(i, j)
' For q = 1 To ccG.CaseCount
' If ccG.IsFull Then
' 'KccG.AddAll()
' End If
' Next
' KccE.Params.Groups.[New](i, ccG.Operator, cas_lst)
' cas_lst = ""
' Next
'Next
'relations
'Dim crel As RobotOM.RobotCodeCmbGroupRelation
'Dim Kcrel As KernelOM.RobotCodeCmbGroupRelation
'For q = 0 To COMB_TYPES
' crel = ccE.Params.Relations.Get(q)
' Kcrel = KccE.Params.Relations.Get(q)
'Next
k.Structure.Cases.CodeCmbEngine.Generate()
End Sub

Rafal Gaweda