Formulas counting closed contours

Use the following formulas to count closed contours in a drawing.

Counting inner or outer contours

You can count inner contours (those placed inside other closed contours in the same style) or outer contours (those that enclose other contours in the same style).

The formula

To count Use
Inner/outer closed contours in a particular style OneUpN.HolesCount(StyleName; CountInnerContours)
  1. THE PARAMETERS
  2. StyleName: The style of the objects that form closed contour. If no style is specified, the Cutting style and its child styles are used.
  3. CountInnerContours Specifies which closed contours in the specified style are counted. Values: Yes = inner contours; No = outer contours. No is the default and can be omitted.
  4. 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$

Examples

The examples that follow show you how to write formulas for counting closed contours and set formatting for the results. The examples refer to the following drawing.

Counting Closed Contours

NOTE: The examples that follow refer to the OneUp1 design frame area. n0 removes the fractional part from the result.

To count In style Use Example
Holes inside the closed contours Cutting $OneUp1.HolesCount( ; yes); n0$ 2
$OneUp1.HolesCount(Cutting; yes); n0$
The outer closed contours $OneUp1.HolesCount(); n0$ 1
$OneUp1.HolesCount(Cutting); n0$
Holes inside the closed contours Perforating 3x1.5 $OneUp1.HolesCount(Perforating 3x1.5; yes); n0$ 15
The outer closed contours $OneUp1.HolesCount(Perforating 3x1.5); n0$ 1
Counting both inner and outer closed contours

You can use a formula to count the total number of contours in a drawing — the inner and the outer ones.

The formula

To count Use
All closed contours in a particular style OneUpN.PanelsCount(StyleName; CountInnerContours)
  1. THE PARAMETERS
  2. StyleName: The style of the objects that form closed contour. If no style is specified, the Cutting style and its child styles are used.
  3. CountInnerContours Specifies which closed contours in the specified style are counted. Values: Yes = inner contours; No = outer contours. No is the default and can be omitted.
  4. 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$

Examples

The examples that follow show you how to write formulas for counting closed contours and set formatting for the results. The examples refer to the following drawing.

Counting Closed Contours

NOTE: The examples that follow refer to the OneUp1 design frame area. n0 removes the fractional part from the result.

Contours to count In style Use Example
All Cutting $OneUp1.PanelsCount( ; yes); n0$; 3
$OneUp1.PanelsCount(Cutting; yes); n0$
Outer $OneUp1.PanelsCount(); n0$; 1
$OneUp1.PanelsCount(Cutting); n0$
All Perforating 3x1.5 $OneUp1.PanelsCount(Perforating 3x1.5; yes); n0$ 16
Outer $OneUp1.PanelsCount(Perforating 3x1.5); n0$ 1

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