- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This should be easy but I am having trouble figuring it out.
I need to get the filename of the ifactory parent file for a given ipart member. I need it work for both .ipt and .iam iparts.
Below is a start on my code. The section I need help with is underlined in red.
Private Sub TestThis ()
Dim oDocPart As PartDocument = Nothing
Dim oDocAssembly As AssemblyDocument = Nothing
If oInventorApp.ActiveDocument.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
oDocPart = oInventorApp.ActiveDocument
Debug.Print("This is a part document. The filename is:" & oDocPart.FullDocumentName)
If oDocPart.ComponentDefinition.IsiPartMember Then
'get the file name of the parent part (that contains the iPart table)
ElseIf oInventorApp.ActiveDocument.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
oDocAssembly = oInventorApp.ActiveDocument
If oDocAssembly.ComponentDefinition.IsiAssemblyMember Then
'get the file name of the parent part (that contains the iPart table)
Else
'not and .ipt or .iam so exit
Exit Sub
End If
End If
End If
End Sub
Solved! Go to Solution.