Using Macro Variables

Macro variables are used in the Macro dialog, and are replaced with actual values when the macro is executed. They are coded in ${variable name} format in the argument part of the CLUI syntax. This is shown in the following example, which saves the currently-open design as "Sample3.pdes", in the same directory:

saveAs filepath:"${dsgnDirPath}\\Sample3.pdes"

Macro variables

The following macro variables can be used.

Variable Description
binDirPath
  • Replaced with the path to the folder where this application is saved.
  • As the path to the program folder is not set in the environment variables, the full path must be specified to execute programs (such as batch programs) using the system command. This macro variable can be used for this purpose.
env: Environment variable name
  • Replaced with the value of the environment variable.
infoFilePath
  • Replaced with the path to the information file. No file exists at the time the macro execution starts.
  • If a file exists at this path when the macro has run, the Message Log shows details of this file.
warningFilePath
  • Replaced with the path to the warning file. No file exists at the time the macro execution starts.
  • If a file exists at this path when the macro has run, the Message Log shows details of this file.
errorFilePath
  • Replaced with the path to the error file. No file exists at the time the macro execution starts.
  • If a file exists at this path when the macro has run, the Message Log shows details of this file.
dsgnPath
(not available in eCADSTAR Schematic Editor)
  • Replaced with the path to the design data file that is being edited. The extension is not included.
dsgnDirPath
(not available in eCADSTAR Schematic Editor)
  • Replaced with the path to the folder of the design data file that is being edited.
cursorPointX
(not available in eCADSTAR Schematic Editor)
  • Replaced with the X-coordinate value of the cursor on the canvas of the design data that is being edited.
  • If the cursor is not currently on the canvas, it is replaced with the last coordinate value of the cursor on the canvas.
  • These coordinates are numeric values that are managed by the system (1 mm is stored as 100000).
cursorPointY
(not available in eCADSTAR Schematic Editor)
  • Replaced with the Y-coordinate value of the cursor on the canvas of the design data that is being edited.
  • If the cursor is not currently on the canvas, it is replaced with the last coordinate value of the cursor on the canvas.
  • These coordinates are numeric values that are managed by the system (1 mm is stored as 100000).
numberOfCondLayers
(not available in eCADSTAR Schematic Editor)
  • Replaced with the number of conductor layers of the design data file that is currently being edited.

 

Note
  • All macro variables are replaced before running the macro. Condition changes that occur when the macros is running are not reflected. For example, even if the file is closed using the Close command in the macro, the macro variable dsgnPath is not affected. In this case, dsgnPath is replaced with the path to the design data file that was edited just before the macro was executed.
  • The value after replacement may include space characters. If it is used in combination with the system command, it must be placed between double quotation marks (") to be correctly interpreted by the command processor (in the above example, double quotation marks are not shown).
  • For the contents of information files, warning files and error files, the character codes must be text data for the system locale, to enable the Message Log to display the details of these files.

 

Related Topics
The Macro Command