Ehaviv
Computer
- Jul 2, 2003
- 1,012
Hi
These journals identical one write to a file only and the second to a file and window
the output of 'write to a file only' have 2 blank lines more then of the 'write to a file and window'
can somone know and explain what hpen
Thanks in advanced.
Journal 1
output 1
*************************************************************************
*************************************************************************
Journal 2
output 2
These journals identical one write to a file only and the second to a file and window
the output of 'write to a file only' have 2 blank lines more then of the 'write to a file and window'
can somone know and explain what hpen
Thanks in advanced.
Journal 1
Code:
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Module ListingWindow_SelectDevice_DeviceType_FileAndWindow
Sub Main()
Dim s As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession
Dim workPart As Part = s.Parts.Work
Dim lw As ListingWindow = s.ListingWindow
Dim nowDateTime As String = Nothing
Dim window2file As String
nowDateTime = Format(Now, "_ddMy_hhmmss")
window2file = "C:\_nx11_\journal_directory\FileAndWindow_" & nowDateTime & ".txt"
'use listing window to write to file and window
lw.SelectDevice(ListingWindow.DeviceType.FileAndWindow, window2file)
ufs.Ui.ExitListingWindow()
lw.Open()
lw.WriteLine("=========================================================")
lw.WriteLine("")
lw.WriteLine("ListingWindow.DeviceType.FileAndWindow = " & window2file)
lw.WriteLine("")
lw.WriteLine("=========================================================")
lw.Close()
'flush file buffer by changing listing window device
lw.SelectDevice(ListingWindow.DeviceType.Window, "")
End Sub
End Module
output 1
Code:
=========================================================
ListingWindow.DeviceType.FileAndWindow = C:\_nx11_\journal_directory\FileAndWindow__05618_073317.txt
=========================================================
*************************************************************************
*************************************************************************
Journal 2
Code:
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Module ListingWindow_SelectDevice_DeviceType_File
Sub Main()
Dim s As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession
Dim workPart As Part = s.Parts.Work
Dim lw As ListingWindow = s.ListingWindow
Dim nowDateTime As String = Nothing
Dim window2file As String
nowDateTime = Format(Now, "_ddMy_hhmmss")
window2file = "C:\_nx11_\journal_directory\File_" & nowDateTime & ".txt"
'use listing window to write to file and window
lw.SelectDevice(ListingWindow.DeviceType.File, window2file)
ufs.Ui.ExitListingWindow()
lw.Open()
lw.WriteLine("=========================================================")
lw.WriteLine("")
lw.WriteLine("ListingWindow.DeviceType.File = " & window2file)
lw.WriteLine("")
lw.WriteLine("=========================================================")
lw.Close()
'flush file buffer by changing listing window device
lw.SelectDevice(ListingWindow.DeviceType.Window, "")
End Sub
End Module
output 2
Code:
=========================================================
ListingWindow.DeviceType.File = C:\_nx11_\journal_directory\File__05618_073702.txt
=========================================================