Support Forum

Project Initialization and layouteditor startup

Monday 13th May 2019
I still have not found a description of the "startup chain of events". I mean, after I type "layout" what init files will be looked for and executed if found? Is there any default filename in the $cwd that layout will read and act upon? I would like something like the "autostart macro" but I want it to be defined from the Linux environment, not from within layout by menu. I saw once in reading through the help docs, something about this but I cannot find it now. Can you give me an example of a command-line invocation of layout (schematic editor would be nice, too) that invokes a local setup script and how to make that script attach layers definition (another macro, maybe?) and whatever other technology dependent "stuff" that would commonly be wanted? Any list of what that might be? Is there a concise documentation of project setup practices? Are there any examples of a "working project" setup macro (chain) that might instruct me? From the help docs: > Autostart Macro > > A autostart macro is a macro that is executed on a defined trigger by the LayoutEditor in a automatic way. The trigger and the name of the macro is set in the setup dialog. Only a single macro can be set as autostart macro. You can detect in the macro which action has triggered the macro. > > Example: > ``` > #!/usr/bin/layout > #name=autostart > #help=example of an automatic start macro > > int main(string trigger){ > debug.clear(); > debug("the autostart macro was triggered by"); > debug(trigger); >; > return 0; > } > ``` > Autostart macros are usefull for initial setups like adjusting userunits, prepare own toolbars, adjust short cuts etc. Defined triggeres on autostart macros were introduced with version 20180420. If the trigger 'layoutStart' and 'layoutNew' is set, the macro is only executed once during LayoutEditor lounch.
Monday 13th May 2019
Starting the LayoutEditor is very simple and straightforward: clicking on the icon on you desktop and everything is done. There is no old-fashioned init file, environment variables, startup chain, etc. The LayoutEditor will always start with the last used configuration. For maybe 99% of the users this should be fine. In case you work with different technologies and realy needs different setting regular, i recommend to create a macro doing all the setup the is different between the two technologies. This macro can be placed anywhere in the menu tree and be called when you want to switch to a different technology. If you really want to make it complicated You can create an autostart macro, that is always called when the LayoutEditzor starts. Within this macro your environment setting are read and the corresponding setup macro is executed. Reading the environment is done with the macro command `process::getEnv("HOME");`