this is what i have at the moment so.
i can get the work point i want in the sub-assembly (WP) and i can get its x,y,z points (WP.Point)
but i cant work out how to make an iMate in the top assembly on that WorkPoint?
can anyone help ?
Public Sub getpoint()
'Define the Document
Dim ThisApplication As Inventor.Application
ThisApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument
Dim tankAsmComp As AssemblyComponentDefinition
tankAsmComp = oDoc.ComponentDefinition
' Get the referenced assembly.
' Dim tankAsm As AssemblyDocument = drawView.ReferencedDocumentDescriptor.ReferencedDocument
'Dim tankAsmComp As AssemblyComponentDefinition = tankAsm.ComponentDefinition
' Get the occurrence of the tank in the assembly.
Dim tankOcc As ComponentOccurrence = tankAsmComp.Occurrences.Item(1)
' Get the tank part.
Dim tankPartComp As AssemblyComponentDefinition = tankOcc.Definition
' Get the work point named "TANKWP".
Dim WP As WorkPoint
For Each WP In tankPartComp.WorkPoints
If WP.Name = "Center Point" Then
'WP.Point
Dim oMateiMateDefinition As MateiMateDefinition
oMateiMateDefinition = tankAsmComp.iMateDefinitions.AddMateiMateDefinition(tankOcc, 0, InferredTypeEnum.kInferredPoint, WP.Point, "test")
'oMateiMateDefinition = tankAsmComp.iMateDefinitions.AddMateiMateDefinition(WP, 0, InferredTypeEnum.kInferredPoint, WP.Point, "test")
End If
Next
End Sub