Click here to Skip to main content
14,329,780 members
   

C#

 
GeneralRe: Copy text from console window Pin
Sharp Ninja10-Sep-19 2:57
memberSharp Ninja10-Sep-19 2:57 
GeneralRe: Copy text from console window Pin
Richard Deeming10-Sep-19 4:13
mveRichard Deeming10-Sep-19 4:13 
AnswerRe: Copy text from console window Pin
Gene M9-Sep-19 20:31
memberGene M9-Sep-19 20:31 
GeneralRe: Copy text from console window Pin
Richard MacCutchan9-Sep-19 21:16
protectorRichard MacCutchan9-Sep-19 21:16 
GeneralRe: Copy text from console window Pin
Dave Kreskowiak10-Sep-19 3:13
mveDave Kreskowiak10-Sep-19 3:13 
GeneralRe: Copy text from console window Pin
Gene M10-Sep-19 7:39
memberGene M10-Sep-19 7:39 
GeneralRe: Copy text from console window Pin
Dave Kreskowiak10-Sep-19 8:49
mveDave Kreskowiak10-Sep-19 8:49 
GeneralRe: Copy text from console window Pin
Gene M10-Sep-19 11:28
memberGene M10-Sep-19 11:28 
I change over to using StreamWriter. I have used it before, I wasn't thinking.

using System.IO;
using (StreamWriter list = new StreamWriter("C:\\Users\\Gene\\Desktop\\Test.scr", true)) {

	list.WriteLine("Line " + cabinetx + "," + topy + " @" + cabinetWidth + ",0\n");
}

I changed from  Console.WriteLine( ) to  list.WriteLine( )
Works great. Beautiful thing. It doesn't print to screen but it does write to a text file.

I use progeCad. (similar to AutoCad)
I saw this online. Running script in Cad program
It draws a 1" square box. And it did it all in 1 line of code.

Line 0,0 @1,0 @0,1 @-1,0 close

Starts a line command. Space is like hitting the spacebar or Enter key.
Where do you want to start from? x,y coordinate 0,0. Space
What's the next point? @1,0. Space. and so forth

After that, I drew a cabinet, used it as a model to gather locations and sizes of Left end, right end, top, deck and measured for precise locations and sizes.
From those measurements I typed out these commands

Rectangle 0,4 @0.75,30.5
Rectangle 30,4 @-0.75,30.5
Rectangle 0.75,34.5 @28.5,-0.75
Rectangle 0.75,4 @28.5,0.75

Saved as a script file (.scr) and ran in progeCad as script file

It drew out in a split second what I had drawn previously for a model
After that, it was like candy. What other parts can I draw?

The program is two parts
First part gathers information- width, height, depth. Top drawer and 1 door, with 2 adjustable shelves. This is done thru user input, to change location, sizes and choice of parts.
Numerous windows display, allowing changes. Window is cleared and the next window is diplayed...

Second part is where all the commands code is generated. (similar to lines of code above)
I copy the command codes, paste in a text file, save as script file and run in progecad
Each line, represents one full command in progeCad. The first line runs and jumps to the next line until the end. It just drew several views of the cabinet.

Using StreamWriter, no more copy and pasting.
Thanks again.

GeneralRe: Copy text from console window Pin
Dave Kreskowiak10-Sep-19 11:43
mveDave Kreskowiak10-Sep-19 11:43 
GeneralRe: Copy text from console window Pin
Gene M10-Sep-19 13:03
memberGene M10-Sep-19 13:03 
Questioncall enum as argument in Method? Pin
Member 145823347-Sep-19 8:55
memberMember 145823347-Sep-19 8:55 
AnswerRe: call enum as argument in Method? Pin
Dave Kreskowiak7-Sep-19 10:31
mveDave Kreskowiak7-Sep-19 10:31 
GeneralRe: call enum as argument in Method? Pin
BillWoodruff7-Sep-19 15:36
mveBillWoodruff7-Sep-19 15:36 
GeneralRe: call enum as argument in Method? Pin
Dave Kreskowiak7-Sep-19 17:21
mveDave Kreskowiak7-Sep-19 17:21 
GeneralRe: call enum as argument in Method? Pin
BillWoodruff7-Sep-19 19:04
mveBillWoodruff7-Sep-19 19:04 
GeneralRe: call enum as argument in Method? Pin
Member 145823347-Sep-19 16:32
memberMember 145823347-Sep-19 16:32 
GeneralRe: call enum as argument in Method? Pin
BillWoodruff7-Sep-19 19:02
mveBillWoodruff7-Sep-19 19:02 
AnswerRe: call enum as argument in Method? Pin
BillWoodruff7-Sep-19 15:29
mveBillWoodruff7-Sep-19 15:29 
AnswerRe: call enum as argument in Method? Pin
BillWoodruff7-Sep-19 19:01
mveBillWoodruff7-Sep-19 19:01 
AnswerRe: call enum as argument in Method? Pin
OriginalGriff7-Sep-19 20:03
protectorOriginalGriff7-Sep-19 20:03 
AnswerRe: call enum as argument in Method? Pin
Gerry Schmitz8-Sep-19 8:09
mveGerry Schmitz8-Sep-19 8:09 
AnswerRe: call enum as argument in Method? Pin
Sharp Ninja9-Sep-19 4:56
memberSharp Ninja9-Sep-19 4:56 
QuestionVlookup a Value on a CSV file C# Pin
Member 1457406731-Aug-19 9:52
memberMember 1457406731-Aug-19 9:52 
AnswerRe: Vlookup a Value on a CSV file C# Pin
OriginalGriff31-Aug-19 19:55
protectorOriginalGriff31-Aug-19 19:55 
AnswerRe: Vlookup a Value on a CSV file C# Pin
BillWoodruff1-Sep-19 12:00
mveBillWoodruff1-Sep-19 12:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.