Share
 
 

Parameters and template pages

You can use parameters to create setup sheets for a project.

Common parameters

There are a number of common parameters that can be used in both setup sheets and macros:

  • Project header — Contains the parameters project.* or powermill.*.
  • NC Program header — Contains the NC Program parameters entity('ncprogram', ncprogram.Name).*.
  • Toolpath page — Contains toolpath and tool parameters such as entity('toolpath', toolpath.Name).* and entity('toolpath', toolpath.Name).Tool.*.
  • Summary page — Contains the parameters <summaryrow> or <toolrow>, in addition to toolpath and tool parameters.

Parameters only used in setup sheets

There are a parameters that can only be used in setup sheets. This is due to the nature of setup sheets: they aim to achieve a goal within a single statement. There are also other restrictions:

  • You cannot use if statements.
  • You cannot re-use variables.
  • Every statement is independent and does not flow as it does in macros.
  • Statements do not start with the entity(…)syntax.

The following table summarises the differences between the use of parameters in macros and setup sheets.

Note: For more information, click Help > Parameters > Documentation > Setup Sheet Summary.

Parameter

Use in macros

Use in setup sheets

Parameter definition

REAL r = 10

Parameter definition is not supported. You can only use previously defined parameters.

Parameter printing

PRINT “Stepover is ${entity('toolpath',

'1').Stepover}”

Stepover is ${entity('toolpath',

'1').Stepover}.

Commands

PRINT “Stepover is ${entity('toolpath',

'1').Stepover}”

You cannot use commands. The effect of putting parameters between ${} brackets is similar to using the PRINT command. The difference is that only the value is printed, and it is printed to the setup sheet file.

If statements

IF (${error(Workplane)} == 0) {

PRINT ${Workplane.Name}

} ELSE {

PRINT “World”

}

Not supported. However, you can use a parameter function to perform simple things which require the same behaviour:

${select(“error(Workplane) == 0”,

Workplane.Name, “World”)}.

While, For loops

Consult the macro manual.

No supported. However, the syntax of <summaryrow> mimics looping over toolpaths. <toolrow> mimics looping over tools.

Note: The toolpath header, NC Program header, and summary HTML pages are repeated for each toolpath or NC Program. However, the parameters depend upon the individual toolpath or NC program PowerMill.

Was this information helpful?