Formulas for counting objects by style
The formulas that follow count how many objects in a specific style
there are in a drawing. Notice that there are two different formulas
— one that counts objects in the specified style but does not count
objects in its child styles, and another formula that counts objects
both in the specified style and its child styles.
Counting objects without child styles
- StyleName: The style of the objects
which you want to count. Objects in its child styles are not
counted.
IMPORTANT: To extract the total length of all
objects in all styles, including the objects in the child styles,
leave the argument empty.
Counting objects with child styles included
Extracts From |
Formula |
1up |
OneUp1.CountAll(StyleName) |
Layout |
Layout1.CountAll(StyleName) |
- 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
objects and set formatting for the results. The first formula does
not include objects in child styles; the second and third examples
include these objects. The n0 rounding
identifier makes sure that the result is printed without a fractional
part.