Message 1 of 15

Not applicable
09-10-2018
05:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm using this code to edit iproperties of all files inside main folder (oFolder):
Sub Main() Dim oFolder As String oFolder = ThisDoc.Path Dim oFiles() As String oFiles = System.IO.Directory.GetFiles(oFolder) Dim oFile As String Dim docFName As String Dim docFName_wo_ext As String Dim FNamePos As Long For Each oFile In oFiles FNamePos = InStrRev(oFile, "\", -1) docFName = Right(oFile, Len(oFile) - FNamePos) docFName_wo_ext = Left(docFName, Len(docFName) - 4) Try iProperties.Value(docFName, "Project", "Part Number") = docFName_wo_ext 'MessageBox.Show(iProperties.Value(docFName, "Project", "Part Number")) Catch MessageBox.Show("Can't edit iproperties of " + docFName) End Try Next InventorVb.DocumentUpdate() MessageBox.Show("Finish!") End Sub
The problem is that the code runs well for all ipts and iams (except the main one) but can't work properly for all idws inside the same folder (oFolder).
Why the code can't edit the main iam file and the idw files?
Can you help me please?
Thanks
EDIT: I use Inventor Professional 2018
Solved! Go to Solution.