04-23-2024
03:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-23-2024
03:25 AM
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