.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Equivalent (textscr) lisp function in C#

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
cadVDJ3M
320 Views, 2 Replies

Equivalent (textscr) lisp function in C#

cadVDJ3M
Enthusiast
Enthusiast

Hello. This seems simple, but none of my attempts have been behaving well.

 

I've tried these ways and none of them have the correct result.

Autodesk.AutoCAD.ApplicationServices.Application.DisplayTextScreen = true;
//Nothing happens...


Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("(TEXTSCR) ", true, false, false);
//Nothing happens...

Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.Command("TEXTSCR");
//Displays undocked text window the first time, nothing in the second time, and display again in the third time.

I would like to display the text window exactly as the AutoLisp (textscr) function behaves, as below.

image.png

Thank you..

0 Likes

Equivalent (textscr) lisp function in C#

Hello. This seems simple, but none of my attempts have been behaving well.

 

I've tried these ways and none of them have the correct result.

Autodesk.AutoCAD.ApplicationServices.Application.DisplayTextScreen = true;
//Nothing happens...


Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("(TEXTSCR) ", true, false, false);
//Nothing happens...

Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.Command("TEXTSCR");
//Displays undocked text window the first time, nothing in the second time, and display again in the third time.

I would like to display the text window exactly as the AutoLisp (textscr) function behaves, as below.

image.png

Thank you..

2 REPLIES 2
Message 2 of 3
norman.yuan
in reply to: cadVDJ3M

norman.yuan
Mentor
Mentor

Do you have code still running after calling Application.DisplayTextScree=true? 

The purpose of showing Text string is to give user chances to look at the information showing in test screen, it is usually followed by asking user to interact with AutoCAD editor (i.e. you hold AutoCAD until user input something), typically something like:

 

Editor.GetString("\nPress any key to continue/end...);

 

Or it is the last line of the code execution.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

Do you have code still running after calling Application.DisplayTextScree=true? 

The purpose of showing Text string is to give user chances to look at the information showing in test screen, it is usually followed by asking user to interact with AutoCAD editor (i.e. you hold AutoCAD until user input something), typically something like:

 

Editor.GetString("\nPress any key to continue/end...);

 

Or it is the last line of the code execution.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3
cadVDJ3M
in reply to: norman.yuan

cadVDJ3M
Enthusiast
Enthusiast
Accepted solution

Hello Norman.

 

I tried this but the result was the same, the text screen is not displayed.

 

CadApp.DisplayTextScreen = true;
ed.GetString("\nPress <ENTER> to continue...");

 

I am currently doing this.

Editor.Command("GRAPHSCR"); // to close undocked text window case its opened on a second plan. 
Editor.Command("TEXTSCR");

This isn't ideal, but it works.

0 Likes

Hello Norman.

 

I tried this but the result was the same, the text screen is not displayed.

 

CadApp.DisplayTextScreen = true;
ed.GetString("\nPress <ENTER> to continue...");

 

I am currently doing this.

Editor.Command("GRAPHSCR"); // to close undocked text window case its opened on a second plan. 
Editor.Command("TEXTSCR");

This isn't ideal, but it works.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report