Formulas for counting line attributes

The formulas that follow count how many lines there are according to:

The formula is handy when inliner production is used and you need statistical information about the number of objects in the Wheel Creasing style that should be processed (see the example in this page).

The formulas

How Many Lines In Use
1up $OneUpN.ToolPosCount(StyleName; ToolDirection; Tolerance)$
Layout $LayoutN.ToolPosCount(StyleName; ToolDirection; Tolerance)$
  1. THE PARAMETERS
  2. StyleName: The name of the style applied to the object that is to be counted.
  3. ToolDirection: The value of the angle that determines the object's direction relative to the x-axis — for example, 0, 45, 90.
  4. Tolerance The variation from the angle value set in ToolDirection in which the object will still qualify for counting. Type a value for the tolerance — for example, 0.25. If you do not want to use a tolerance variation, type zero (0).
  5. Know your list separator: When typing a formula, make sure you separate its elements with your computer's list separator symbol. Yours may be different from the one used in this guide. Examples (in red):
    With Semicolon With Comma
    $Layout1.Length(Cutting; m; yes); n2$ $Layout1.Length(Cutting, m, yes), n2$

Counting lines by angle

Examine the following 1up drawing and the follow-on example to learn how to apply the formula. The formula extracts how many lines in the Wheel Creasing style there are in a design in the position determined by the angle.

Formula Result
$OneUp1.ToolPosCount("Wheel Creasing", 90, 0)$ 4
$OneUp1.ToolPosCount("Wheel Creasing", 0, 0)$ 2

Counting lines relative to the flute direction

You can count objects by how they line up relative to the direction of the flute. For example, you can count how many lines in a specifiied style there are in a drawing by considering whether they line up along the flute direction or against it. When you want to consider the flute direction, you apply the fd() function in the ToolDirection argument. The function gives you the flute direction.

To extract the number of lines against the flute direction, you use the fd(); to extract the number of lines along the flute direction, you use the 90+fd().

Examples

In the examples that follow, the same formulas produce different results, because of the different direction of the flute. We count how many lines in the Wheel Creasing style there are in a design when it has different flute directions.

Flute Dir Use Flute Y Flute X
Against $OneUp1.ToolPosCount("Wheel Creasing", fd(), 0)$ 4 2
Along $OneUp1.ToolPosCount("Wheel Creasing", 90+fd(), 0)$ 2 4

See the general rules for how to write formulas and format formula results.