Script Editor/Runner

<< Click to Display Table of Contents >>

Navigation:  Reference > Dialogs > Plugins Dialogs >

Script Editor/Runner

Previous pageReturn to chapter overviewNext page

dlg_plugins_script_zoom33


Explanation

Often times there are operations that you find yourself repeating some thing or process endlessly. Scripts are a good way to automate those processes. There are many example scripts to browse through and see how they work. Example scripts can be found at:

c:\users\public\documents\WireCAD\WireCAD9\scripts\*.cs

 

 

NOTE: Scripts that run in WireCAD MUST have the following method signature or they will not execute:

 

using System;

using System.Data;

using System.Text;

using System.Windows.Forms;

using System.Diagnostics;

using System.Reflection;

using WireCAD;

using WireCAD.Interfaces;

//You may add additional using statements as needed but the listed ones are the minimum.

 

public class Script

{

 public static void Run(Workspace ws)

 {

         //do your stuff here

 

 }

}

 

 

Possible Uses

1.Title block filling.

2.New Drawing creation.

3.Database cleanup.

 

Usages

1.Launch the tool.

2.File>Open an example script. (c:\users\public\documents\WireCAD\WireCADx\Scripts\).

3.Read the comments (they are the ones proceeded by //).

4.Tweak the script to suit your needs.

5.Run it by clicking the [RUN] button

snip_plugins_script_run

6.Fix any compiler errors. Lather, rinse, repeat.

 

Dialog Options

New - Creates a new script with the necessary method signature.

Open - Opens a .cs file to run.

Comment - Comment out your selection. Useful for hiding code from the compiler without deleting it.

Un Comment - Un comment your selection.

Indent, Out dent

Run - If the Error List is empty then Do It. If if fails it will tell you why in the Compiler Output window.

snip_plugins_script_run

Window On Top - Make this the topmost window always.

Error List - Design time scripting syntax errors.

Compiler Output - Run time compiler and script execution errors, as well as Trace messages.