log points into a _dat file
log points into a _dat file
(OP)
Hi
Would like some help with "writing" points of workpart in a _dat file in real time. So far the code bellow exports the points to a file and then closes it. Can we use a File Mode to keep the file open and still write on it?
Code:
Dim outFile As IO.StreamWriter
outFile = My.Computer.FileSystem.OpenTextFileWriter("C:\test.txt", False)
outFile.AutoFlush = True
outFile.WriteLine(thisPoint.Coordinates.X.ToString("F6") & ", ")
outFile.Close()
Would like some help with "writing" points of workpart in a _dat file in real time. So far the code bellow exports the points to a file and then closes it. Can we use a File Mode to keep the file open and still write on it?
Code:
Dim outFile As IO.StreamWriter
outFile = My.Computer.FileSystem.OpenTextFileWriter("C:\test.txt", False)
outFile.AutoFlush = True
outFile.WriteLine(thisPoint.Coordinates.X.ToString("F6") & ", ")
outFile.Close()





RE: log points into a _dat file
Marc
NX Software Developer
RE: log points into a _dat file
What about loading them in dlg box? Can we have two or more dlg boxes open at the same time?
RE: log points into a _dat file
Marc
NX Software Developer
RE: log points into a _dat file
So that's the reason I want to keep a text file or dialog box open continuously and populate it with for e.g the updates of a tracked expession.
Ps: Can a dlg box open (push) another dlg box to open? What can't of code is required?
Thanks for the interest Marc.
RE: log points into a _dat file
Yes, this should be possible. However, as far as I know, these dialogs are modal (http://en.wikipedia.org/wiki/Modal_window). That means the user won't be able to continue until the dialog has been closed first.
What you want to do seems rather complex and could eat up a lot of performance. Do you want to track changes to certain expressions every time they change (n logs), or only those changes when the user opens a part, then saves it (2 logs)?
There might be a possible solution using certain callbacks, but this requires an extensive knowledge of NX and solid programming skills.
Marc
NX Software Developer
RE: log points into a _dat file
Then I might need to find a different way around it.