#
File generation customization
With ECAM is possible customize the file generation logic.
For example is possible change the default text editor, copy the g-code to clipboard, call external routine and so on.
If you need further customization , mail me.
###File Auto Generation
* [Post Processor documentation - HOME - ](post_processor.md)
Is possible to **synchronize** the file immediately after any edit.
This means the output file will be automatically updated , without any user intervention.
To **turn on** this feature simply check **[File Synchronization]** in the file generation dialog.
![](send_file.png)
In the status bar, an icon will appear when the file is in synchronization.
![](auto_file.png)
**Green** ![](status_file_green.png) if successful.
**Red** ![](status_file_red.png) if something went wrong.
____
###Prevent Text Editor Opening
You can the prevent the text editor opening, checking the **[Prevent Run Editor]** in preference dialog.
See image below.
###Copy to clipboard
To copy to clipboard the generated g-code , turn on **[Copy To Clipboard]** .
![](file_gen_001.png)
____
###Customize G-Code Editor
You can select a different g-code editor, press the link highlighted in the image .
And select your preferred editor.
![](file_gen_002.png)
____
###Command line hooks
*from v. 2.2.0.832*
Is possible call external command line instruction in several point.
Before g-code file save
After g-code file save
Before g-code file sending
You can call many command for every hooks, just separate these command with a **;** char.
From preference dialog search "hooks" to find these property :
![](hooks.png)
#####Example 1 :
You want to call a command before and one command after file generation , these case you need to set :
In the **[Before file generation]** property :
```
MachUtil.exe --close-gcode
```
and in the **[On file generated]** property :
```
MachUtil.exe --open-gcode {GCODE_FILEPATH}
```
The **{GCODE_FILEPATH}** tag is the g-code filepath.
____
#####Example 2 :
Instead of using RS232 communication, maybe you want to use a custom logic.
You can create this custom logic in a external console application .
In these case , you need to set the **communication mode to CUSTOM** :
![](communciation_,mode.png)
And in the **[Before file sending]** property set , for example , this string:
```
MachUtil.exe --close-gcode ; MachUtil.exe --open-gcode {GCODE_FILEPATH}
```
In this way when you press the **[Send File]** button, the logic inside your console application, will be called .
![](custom_send_file.png)
____