Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

log points into a _dat file

Status
Not open for further replies.

Zoes

Mechanical
Sep 30, 2011
46
GB
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()
 
Replies continue below

Recommended for you

Not that I'm aware of. As far as I know, the Close method writes the buffer (memory) to file and saves it. If you keep the file open, you will only write to memory (e.g. the StreamWriter).

Marc
NX Software Developer
 
I see...
What about loading them in dlg box? Can we have two or more dlg boxes open at the same time?
 
No (at least I don't think so). What are you trying to accomplish? There might be an easier way to reach your goal.

Marc
NX Software Developer
 
Track the history of changes of an expression_value or points of a workpart.
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.
 
Ps: Can a dlg box open (push) another dlg box to open? What can't of code is required?

Yes, this should be possible. However, as far as I know, these dialogs are modal ( 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
 
Yes I would like to track changes of certain expressions every time they change.

Then I might need to find a different way around it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top