I'll be a little more specific.
I would like to select one of the ipt states from a combo box.
Insert the selected state into the assembly.
I practice programming in visual studio 2019, but I can't find anything about the states that would be in C #.
I would like to ask for an example of a C # language for state control
Inventor 2022 api help example that's not what I want VB.NET:
Public Sub CreateModelState()
' Set a reference to the assembly component definintion.
' This assumes an assembly document is open.
Dim oAsmCompDef As AssemblyComponentDefinition Set oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
' Set a reference to the transient geometry object.
Dim oTG As TransientGeometry Set oTG = ThisApplication.TransientGeometry
' Create a matrix. A new matrix is initialized with an identity matrix.
Dim oMatrix As Matrix Set oMatrix = oTG.CreateMatrix
' Add the first occurrence.
Dim oOcc1 As ComponentOccurrence
Set oOcc1 = oAsmCompDef.Occurrences.Add("C:\Temp\Part1.ipt", oMatrix)
' Set the translation portion of the matrix so the ' second part will be positioned at (3,2,1).
Call oMatrix.SetTranslation(oTG.CreateVector(3, 2, 1))
' Add the second occurrence.
Dim oOcc2 As ComponentOccurrence
Set oOcc2 = oAsmCompDef.Occurrences.Add("C:\Temp\Part2.ipt", oMatrix)
' Create a new level of detail representation.
' The new representation is automatically activated.
Dim oModelState As ModelState
Set oModelState = oAsmCompDef.ModelStates.Add("Part2Suppressed")
' Suppress the second component in the new model state.
' If the document "C:\Temp\Part2.ipt" is not currently referenced
' elsewhere, it will be closed.
oOcc2.SuppressEnd Sub