×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

log points into a _dat file

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()
 

RE: log points into a _dat file

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
 

RE: log points into a _dat file

(OP)
I see...
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

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
 

RE: log points into a _dat file

(OP)
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.

RE: log points into a _dat file

Quote:

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 (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

(OP)
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.

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources