Class Reference macro

Class to get information on the currently running macro More...

Member

string filename()
bool isAutostart()
string trigger()

Detailed Description

Class with only static members to get infos on the durrently running macro

Example:

 if (! macro::isAutostart()&&(macro::filename()!="")){ 
         setup::autostartMacro=macro::filename();
         if (!setup::autostartMacroTrigger.contains("layoutOpen")) setup::autostartMacroTrigger.insert("layoutOpen");
         return 0;
 }

 // if this macro was triggered by an layout open event, check file folder for an second level autostartmacro
 if (macro::trigger()=="layoutOpen") {
     //.....
 }

This class exists only for the LayoutEditor C++ Macros as other scripting cannot be triggered by an event. This class was introduced with release 20201021.

Member Function Documentation


static string macro::filename()

Returns: the complete filename includ its full path of the macro calling this function


static bool macro::isAutostart()

Returns: true if the execution of this macro was triggered by an event like layout open. Otherwise false is returned.


static string macro::trigger()

Returns: the name of the event triggering this macro. Supported events are: layoutOpen, layoutStart, layoutNew, schematicNew