<< Click to Display Table of Contents >> Script Editor/Runner |
|
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
6.Fix any compiler errors. Lather, rinse, repeat.
•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.
•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.