Hi @rbertoletti. To do that, you would need to use the ComponentOccurrences.AddWithOptions method, instead of the standard ComponentOccurrences.Add method. The one with options lets us specify up to 5 additional settings that the other one does not. Below is a very basic example of how to use it.
Sub Main
Dim oInvApp As Inventor.Application = ThisApplication
Dim oADoc As AssemblyDocument = TryCast(ThisDoc.Document, Inventor.AssemblyDocument)
If oADoc Is Nothing Then Return
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oConsts As AssemblyConstraints = oADef.Constraints
Dim sFileName As String = "C:\Temp\MySubAssembly.iam"
Dim oPosition As Inventor.Point = oInvApp.TransientGeometry.CreatePoint(3, 6, 9)
Dim oOptions As Inventor.NameValueMap = oInvApp.TransientObjects.CreateNameValueMap()
oOptions.Add("DesignViewRepresentation", "Default")
oOptions.Add("DesignViewAssociative", True)
Dim oNewOcc As ComponentOccurrence = oOccs.AddWithOptions(sFileName, oPosition, oOptions)
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)