Hey guys,
I'm new to inventor and I need to be able to create coppies of a part in my assembly that are uniquely identified so they can be individually changed. I see that this can be done through the ribbon with the "Place iLogic Component" button, but is it possible to do this from the API in a rule?
I am using inventor 2012 pro.
Thanks
I found that its possible with this code:
' set a reference to the assembly component definintion.' This assumes an assembly document is open.Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition ' Set a reference to the transient geometry object.Dim oTG As TransientGeometry oTG = ThisApplication.TransientGeometry ' Create a matrix. Dim oMatrix As Matrix oMatrix = oTG.CreateMatrix 'Iterate through all of the occurrencesDim oOccurrence As ComponentOccurrence 'place an instance of the component 'in this case at 0,0,0oOccurrence = oAsmCompDef.Occurrences.Add(oPath & oFile, oMatrix) ' Set the translation portion of the matrix so the part will be 'positioned at the co-ordinatesoMatrix.SetTranslation(oTG.CreateVector(0, 0, 0)) 'ground it in placeoOccurrence.Grounded = True
But, for some reason, my model only appears at coordinates 0,0,0 even if i change it to something else. Could it be that the TransientGeometry is not being used correctly in my case?
I have found that the code provided above does not make unique copies like the iLogic Place Component part button does. Is there anyway to replicate that functionality?