I have a part with a iMate in it called Part1.ipt
This part is inserted in a assembly called assy1.iam
assy1 is inserted in another assambly called assy2.iam.
I work with INV 2011 and VB6
I now want to get the entity where the iMate is based on from out of Assy2
I tried this with no result:
'oAsmCompDef = Assy2
'oOcc = Assy1
'oOccInsert = Part1
Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef = objInventorApp.ActiveDocument.ComponentDefinition
Dim oOcc As ComponentOccurrence
Set oOcc = oAsmCompDef.Occurrences.item(1)
Dim oOccInsert As ComponentOccurrence
Set oOccInsert = oOcc.SubOccurrences.Item(1)
'Get proper iMate
For i = 1 To oOccInsert.iMateDefinitions.Count
If oOccInsert.iMateDefinitions.Item(i).Name = "Insert In1" Then
Dim oiMate As Inventor.iMateDefinition
Set oiMate = oOccInsert.iMateDefinitions.Item(i) 'iMate is found
Exit For
End If
Next i
Dim oInsertEdge As iMateDefinition 'Edge
Set oInsertEdge = oiMate.ReferencedEntity -> this gives Nothing
Any clue?
Regards,
Geert
Edited by: GVDB on May 31, 2010 3:00 PM
Edited by: GVDB on May 31, 2010 3:01 PM