Here is a VBA sample to do this:
Sub GetFrameInfo()
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oAtts As AttributesEnumerator
Set oAtts = oDoc.AttributeManager.FindAttributes
' Get the MasterFrameOcc
Dim oMasterFrameOcc As ComponentOccurrence, oCol As ObjectCollection
Set oCol = oDoc.AttributeManager.FindObjects(, "Type", "MasterFrameOcc")
Set oMasterFrameOcc = oCol.Item(1)
Debug.Print "Frame occurrence: " & oMasterFrameOcc.Name
' Get the custom constraint added between the frame control geometry and frame document geometry
Dim oFrameConstraint As CustomConstraint
Set oCol = oDoc.AttributeManager.FindObjects(, "com.autodesk.FG.CustomConstraint.Name", "com.autodesk.FG.FrameGenerator")
Set oFrameConstraint = oCol.Item(1)
Dim oTempOccu As ComponentOccurrence, oControlOccu As ComponentOccurrence
Set oControlOccu = oFrameConstraint.OccurrenceOne
If oControlOccu Is oMasterFrameOcc Then
Set oControlOccu = oFrameConstraint.OccurrenceTwo
End If
Debug.Print "Control occurrence: " & oControlOccu.Name
End Sub
Hope it helps.
If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.
Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.