Can you write all status message to file?

Post anything you want to discuss with others about the software.

Can you write all status message to file?

Postby Mudden » Wed Jan 10, 2024 9:43 am

Hi!

We write a lot of information in the UCCNC status message window.
Is it possible to dump the information in the status message window to a file on disk, to open in Notepad?

I know I can write messages to file from macro, but is there already a built in functionallity to somehow get the messages in the status window over to an editor? I want to be able to perform a search-operation in the output messages.

messagewindow.JPG
Mudden
 
Posts: 19
Joined: Thu Oct 26, 2023 9:09 am

Re: Can you write all status message to file?

Postby ger21 » Wed Jan 10, 2024 11:54 am

You could open a file and write each message to the file when you write it to the status window. I've never done it, so I can't tell you how, but it should be possible.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Can you write all status message to file?

Postby dezsoe » Wed Jan 10, 2024 2:08 pm

Normally when I write to the status box I also write to the console. (Console.WriteLn) In 1.2114 the Console plugin was rewritten and in the plugin window you can right click to get a local menu where you can copy all the contents of the console.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Can you write all status message to file?

Postby dezsoe » Thu Jan 11, 2024 6:10 pm

To read the status box use AS3.Getlist() then use a StreamWriter to write the lines in reverse order:

Code: Select all
// ================================================================================================
// List status box messages to file
// ================================================================================================

List<string> lst = AS3.Getlist(2);

using (System.IO.StreamWriter sw = System.IO.File.CreateText(@"E:\status.txt"))
{
  for (int i = lst.Count - 1; i >= 0; --i)
    sw.WriteLine(lst[i]);
  sw.Close();
}

Result:
M1151.png
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 23 guests