Here it is. The source code, exe, and a pic.
/*
* Created by SharpDevelop.
* User: Tim Willey
* Date: 5/7/2009
* Time: 9:30 AM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
namespace WindosApps
{
/// <summary>
/// Description of ScriptWriter2.
/// </summary>
public partial class ScriptWriter2 : Form
{
public ScriptWriter2()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
[STAThread]
public static void Main(string[] args)
{
Application.Run(new ScriptWriter2());
}
void CanBtnClick(object sender, EventArgs e)
{
this.Close();
}
void SelectDrawingsBtnClick( object sender, System.EventArgs e )
{
if ( FileBtn.Checked ) {
System.Windows.Forms.OpenFileDialog Dia = new System.Windows.Forms.OpenFileDialog();
Dia.DefaultExt = "dwg";
Dia.Filter = "AutoCAD Darwings (*.dwg)|*.dwg;*.dxf";
Dia.Multiselect = true;
Dia.Title = "Select drawings to plot.";
if (Dia.ShowDialog() == DialogResult.OK) {
string[] FileNames = Dia.FileNames;
Array.Sort( FileNames );
foreach ( string str in FileNames ) {
DwgBox.Items.Add( str );
}
}
}
else {
System.Windows.Forms.FolderBrowserDialog Dia = new System.Windows.Forms.FolderBrowserDialog();
Dia.ShowNewFolderButton = false;
Dia.Description = ( FldrBtn.Checked ? "Select folder of drawings." : "Select top folder of drawings." );
if ( Dia.ShowDialog() != DialogResult.OK ) return;
DirectoryInfo Di = new DirectoryInfo( Dia.SelectedPath );
FileInfo[] Files = Di.GetFiles( "*.dwg", ( FldrBtn.Checked ? SearchOption.TopDirectoryOnly : SearchOption.AllDirectories ) );
foreach ( FileInfo fi in Files ) {
DwgBox.Items.Add( fi.FullName );
}
}
}
void DrawingSelectionStyleButtonClick ( object sender, System.EventArgs e )
{
FileBtn.Checked = false;
FldrBtn.Checked = false;
FldrSubBtn.Checked = false;
RadioButton Rb = sender as RadioButton;
Rb.Checked = true;
}
void CloseOptionClick ( object sender, System.EventArgs e )
{
CloseBtn.Checked = false;
CnSaveBtn.Checked = false;
RadioButton Rb = sender as RadioButton;
Rb.Checked = true;
}
void SelectPathButtonClick ( object sender, System.EventArgs e )
{
System.Windows.Forms.FolderBrowserDialog Dia = new System.Windows.Forms.FolderBrowserDialog();
Dia.Description = "Select folder to place script file within.";
if ( Dia.ShowDialog() != DialogResult.OK ) return;
PathBox.Text = Dia.SelectedPath + "\\MyScript.scr";
}
void CreateScript ( object sender, System.EventArgs e )
{
using ( StreamWriter Sw = new StreamWriter(PathBox.Text) ) {
foreach ( string str in DwgBox.Items ) {
Sw.WriteLine( "_.Open" );
Sw.WriteLine( "\"" + str + "\"" );
foreach ( string cmd in CmdBox.Lines ) {
Sw.WriteLine( cmd );
}
Sw.WriteLine( CloseBtn.Checked ? "_.Close _yes" : "_.Qsave _.Close" );
}
Sw.WriteLine( "" );
}
this.Close();
}
}
}