Scripting Overview

EXPERIMENTAL STAGE

from version 3.2.0.687


Through the scripts , is possible automatize the creation of the machining operations and the geometries.

In this way , you can create scripts to speed up your common workflow or expand the software capabilities.

This is a newly added feature (January 2018) , so if you have some feedback about it or you can't cover a particular scenario, please send me an email .

Is possible copy and paste existing scripts from this documentation site , or create them on your own , but in this case a minimum of programming skill is required.

The programming language to create these script is C# . All script file have .CSX extension.


Command Line

Since it's a experimental software feature, you need to enable the related user interface control through preference dialog.

From Menu -> Edit -> Preference -> search "Show Command Line" and enable it , save and close the dialog.

Now in the bottom window you can see this control.

Click on this bottom to clear the command line .

Click on this one to open the Script Editor


ECam Script Editor

This below is the interface of the script editor. On the left colum you can find the existing script in your library.

On the right is visible the text editor.

It's available code contextual autocompletion and error report on the fly. If there is something wrong a red indicator will appear under the related code .

The script base directory is :

C:\Users\<user-name>\Documents\ECAM V3\Scripts

You can import ( or export ) script files by just moving them in this directory.

Add New script file

To add a new script file , click on the white button in the bottom left window.


Function Overview

A script file is composed by several functions. A tipical function has this structure :

public void FunctionName()
{
   //here goes your code 
}

The function body is embraced by two curly braces { ... }

Through the tutorials you'll find further functions examples, but if you need deeper explanation, search documentation about C# language on google.


Code Comment

You can insert comments into script file .

// A couple of backslash at line start to create a one-line comment

or

/* 
embrace the comment in this way 
for multiline comment
*/

The comment are ignored by script execution.


Note :

"ECam script editor" is a forked project of RoslynPad created by Eli Arbel.

results matching ""

    No results matching ""