![]() | Macro Programming | ![]() |
Introduction no help | IntroductionThe LayoutEditor offers a wide range of using macro or scripting. Starting with simple recording of macros until a complete adjustment of the user interface or integrating external software tools. Fundamental parts of the macro programing are: Contents:
Macro RecordingThe simplest way to use macro 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 way an can be edited with any text editor. The recording can be started via Start Macro Recording and stopped via Stop Recorded Macro. After stopping the recording you will be asked for a location to store the macro. Store macros can be executed via Execute Macro function. Alternative you can store the macro file in a specially named folder (setup). All macros in that folder and its sub folders will be included into the main menu of the LayoutEditor. Data StructureStructure Overview
Layout Window Structure
Cell Data Structure
C/C++ MacrosAll macros are text-files and stored somewhere below the "macros"-directory in the layout installation-directory. During program launch these directory-tree is scanned and add to the mainmenu. A modification of the macro-program is possible while the layout-program is running. Creating of macros had to be done in a text editor. Macro-examples are supplied with the LayoutEditor. If you program macros, which may be interesting for the general public, please contribute them to this project. They will be added to the next release. If you don't want this, feel free to keep it back. Structure of MacrosAll macros are in a pseudo C/C++ code. They had to start as follow:
#!/path_to_the_layout/layout The main-function in the macro is executed. If a exitcode unequal 0 is returned, a warning is display. All called function had to be defined before the main function.
int main(){
As standard types you can use int, double, bool, void. Additional there are further type like string, point, pointArray, etc. The usage of pointers is possible. Pointer on pointer are not allowed. while, do ... while, for and if structures can be used. switch, enum and struc structures are not allowed and will case a termination. Own functions can be created, own classed are not possible. Compiler commands unless '#include' are ignored. Comments are possible.
Most of the drawing relevant classes can be accessed via the class layout. Python MacrosThe use of python macros requires 'pylayout'. Pylayout is a python module with all the feature of the LayoutEditor. It is shipped with the LayoutEditor in some packages. It is not and will not be avaiable for some older plattform versions.
#!use python This simple example will add a box to the current cell on the active layer.
Note: Python Program ExtensionsThe main LayoutEditor window as well as the juspertor library manager is written in python. These python sources are free and can be adjusted by anyone. You can add new features, integrate other tools or even embed the LayoutEditor into any other python program. The LayoutEditor uses the qt library for the graphical user interface and any of its feature is available for adaptions. Please see the python-qt bindings documentations for details.
Multithreading - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
© 2009-2010 juspertor UG (haftungsbeschränkt), © 2004-2009 Jürgen Thies