I'm using following VBA macro for this. You need to display Locals window in VBA editor and run this method.
You can see in Locals
- First selected object
- All selected objects
- Application
- Active document
- Active edit document (Edited part in assembly context)
- Active edit object (Active sketch for example)
Now you can expand all of them and look what is inside
For quick info what is selected I print to Immediate window type of first selected object. For this you need to implement conversion function (ObjectTypeEnumToString). This function is too big to paste here, but you can generate the code using iLogic.

Spy function (VBA)
Public Sub Spy()
Dim SelectedObject As Variant
Dim Selection As ObjectCollection
Dim app As Inventor.Application
Set app = ThisApplication
Dim ActiveDoc As Document
Set ActiveDoc = app.ActiveDocument
Dim EditedDoc As Document
Set EditedDoc = app.ActiveEditDocument
Dim ActiveObject As Variant
Set ActiveObject = app.ActiveEditObject
MainCode:
On Error GoTo ErrLine1
Set SelectedObject = ActiveDoc.SelectSet.Item(1)
Set Selection = app.TransientObjects.CreateObjectCollection(ActiveDoc.SelectSet)
Debug.Print ObjectTypeEnumToString(SelectedObject.Type)
Stop
Exit Sub
ErrLine1:
Debug.Print "<No Selection>"
Set SelectedObject = ThisApplication
Stop
End Sub
ObjectTypeEnumToString function stub (VBA)
Function ObjectTypeEnumToString(t As ObjectTypeEnum) As String
Select Case t
Case kEdgeCollectionObject: ObjectTypeEnumToString = "kEdgeCollectionObject": Exit Function
...
End Select
End Function
ObjectTypeEnumToString code generator (iLogic)
This function creates full code and set them to the system clipboard. Then you can just paste the code to VBA module
Dim code As New System.Text.StringBuilder
Dim ote = ThisDoc.Document.Type
Dim oteType As Type = ote.GetType()
code.AppendLine("Function ObjectTypeEnumToString(t as ObjectTypeEnum) As String")
code.AppendLine(" Select Case t")
For Each value In [Enum].GetValues(oteType)
Dim name = [Enum].GetName(oteType, value)
code.AppendFormat(" Case {0}: ObjectTypeEnumToString = ""{1}"": Exit Function{2}", value, name, vbCrLf)
Next
code.AppendLine(" End Select")
code.AppendLine("End Function")
System.Windows.Forms.Clipboard.SetText(code.ToString())
MsgBox("Code is in clipboard", Title :="ObjectTypeEnumToString")
I hope it helps