Hi tmayesPUD23,
The API sample posted previously creates a new part file and then creates some geometry from scratch. Most likely that is not what you're attempting to do, and so depending upon your level of knowledge with programming in Inventor, it might be difficult to adapt that example.
With that in mind, attached is a working example (Inventor 2017 file) based off of the API sample, that uses existing geometry and creates 2 imates, one on both ends. Also, below is the code in case it helps someone find this topic in a future search.
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
' Create a new part document, using the default part template.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
' a reference to the component definition.
Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
Dim oExtrude1 As ExtrudeFeature
oExtrude1 = oCompDef.Features.ExtrudeFeatures("Extrusion1")
' Create a mate iMateDefinition on a side face of the first extrude.
Dim oMateiMateDefinition As MateiMateDefinition
oMateiMateDefinition = oCompDef.iMateDefinitions.AddMateiMateDefinition( _
oExtrude1.StartFaces.Item(1), 0, , , "MateA")
' Create a match list of names to use for the next iMateDefinition.
Dim strMatchList(2) As String
strMatchList(0) = "InsertA"
strMatchList(1) = "InsertB"
strMatchList(2) = "InsertC"
' Create an insert iMateDefinition on the cylindrical face of the second extrude.
Dim oInsertiMateDefinition As InsertiMateDefinition
oInsertiMateDefinition = oCompDef.iMateDefinitions.AddInsertiMateDefinition( _
oExtrude1.EndFaces.Item(1), False, 0, , "InsertA", strMatchList)
