09-24-2020
03:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-24-2020
03:17 AM
Try below iLogic code to write part name if does not exists.
Dim name As String = ThisDoc.FileName(False)
Dim Path As String = "C:\temp\Testing.txt"
Dim file As System.IO.StreamReader = New System.IO.StreamReader(path)
Dim found As Boolean = False
For Each Line As String In System.IO.File.ReadAllLines(path)
If Line.Contains(name) = True Then
found = True
Exit For
End If
Next
file.Close()
If found = False Then
oAppend = System.IO.File.AppendText(path)
oAppend.WriteLine(ThisDoc.FileName(False))
oAppend.Flush()
oAppend.Close()
End If
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
