Page 1 of 1

Showing multi-line message in the command window

Posted: Tue Dec 17, 2019 5:50 pm
by geza.szabo
Hi, I am writing a plugin for MS IntelliCAD using C# and the .net assemblies of MSIntelliCad.

I am unable to output a multi line message.

First of all a single line messageworks:

Code: Select all

var ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("Test");
The following code outputs "TestTest" which is fair enough

Code: Select all

var ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("Test");
ed.WriteMessage("Test");
So I try to add new line at the end

Code: Select all

var ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("Test" + Environment.NewLine);
ed.WriteMessage("Test" + Environment.NewLine);
This does not produce any message.

Is it possible and how to output multi-line message?

And another related question. The plugin makes some extensive calculations and I would like to write messages as the calculations run. What I have found is that messages are displayed only when the plugin command finished processing and not when the WriteMessage call is made. Is there a way to refresh the UI to show the messages beforehand? I have tried System.Windows.Forms.Application.DoEvents(); and also ed.UpdateScreen(); without success.

Thank you kindly
Geza

Re: Showing multi-line message in the command window

Posted: Tue Dec 17, 2019 6:48 pm
by QuanNguyen
Hi Geza,
Please use "\n" instead of Environment.NewLine.
Regards.

Code: Select all

            ed.WriteMessage("\nTest 0");
            ed.WriteMessage("\nTest 1");
            ed.WriteMessage("Test 2\n");
            ed.WriteMessage("\nTest 3");
            ed.WriteMessage("Test 4");