Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I would like to get the filename of the first part in an assembly. I have some code which will get the filename of an instance in the assembly, but it does not work as i would expect. Item(3) returns the value of the fist part, while Item(1) is for the last component.
openDoc = ThisDoc.Document Dim docFile As Document Dim docName As String docFile = openDoc.ReferencedDocuments.Item(3) docName = System.IO.Path.GetFileName(docFile.FullFileName) MessageBox.Show(docName, "Filename")
How do I reliably get the filename of the part at the top of the feature tree, when the number of parts will change in different assemblies.
Screenshot attached
Solved! Go to Solution.