The build-in scripting interface of the LayoutEditor allows to access and modify the design as well as control and adjust the user interface. This scripting is made with simple text files in a C/C++ style and can be used in all areas with the design, user interface, callbacks and parametric cell creation from the schematic. C++ Scripts / Macros will always work with the current opened design. An identical Application Program Interface (API) for all scripting interfaces will make is easy to switch to Python, if required.
The simplest way to use macros is macro recording. Like many office programs the LayoutEditor can record the operations you have done with the graphical user interface. The operation are stored in a C/C++ style and can be edited with any text editor. The recording can be started via Start Macro Recording and stopped via Stop Recorded Macro both located under Mainmenu/Utilities/Macros. After stopping the recording a TextEditor will be opened with the recorded macro and can be executed directly inside the TextEditor. Stored macros can be executed via the Execute Macro function or added as a new item to the menu or to a toolbar. Macro Recording will work for most features. Just features handling with more than one LayoutEditor windows like Separate layer are not recored.
Example of a recored Macro
#!/usr/bin/layout
#name=created 08.10.17
#help=This macro was recorded Sonntag, 8. Oktober 2017 22:40:34 CEST.
int main(){
layout->drawing->point(13000,-8000);
layout->drawing->point(42000,-29000);
layout->drawing->box();
layout->drawing->point(30000,-22000);
layout->drawing->point(53000,-36000);
layout->drawing->box();
layout->drawing->selectAll();
layout->drawing->mergeSelect();
layout->drawing->point(32000,-22000);
layout->drawing->rotate(40.000000);
}
To edit macros a TextEditor is integrated into the LayoutEditor. A manual for it should be obsolete. So just some catchwords for it:
The binary GDSII file is automatic converted to a text file and can be edited and stored.