Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hi @vpeuvion 

 

The native object of the parent of the parent should provide you the correct object.

 

I just realized this wasn't returning what I thought it was... I'll try and have another look later

 

update: see version below that uses the ParentOccurrence of the parent.parent

 

Sub Main
	Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select Face")
	If oFace Is Nothing Then Exit Sub		

	If TypeOf oFace.Parent.Parent Is ComponentOccurrenceProxy Then
		MessageBox.Show(oFace.Parent.Parent.ParentOccurrence.name)
	ElseIf TypeOf oFace.Parent.Parent Is ComponentOccurrence
		MessageBox.Show(oFace.Parent.Parent.Parent.Document.Displayname )
	End If
End Sub

 I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com