Counting objects by applying filters

The formulas that follow extract information about how many objects there are in a drawing which meet filter criteria.

Learn more about how to create and apply object filters.

To use the formulas, you need to have created a filter that must be of the Shared type. Then in FilterName, you supply the filter's name as an argument.

The functions

Extracting To Extract From
  The Active Drawing Drawing Specified By
System Name User-Defined Name
Number of objects CountByFilter(FilterName) OneUpN.CountByFilter(FilterName) "DrawingName".CountByFilter(FilterName)
LayoutN.CountByFilter(FilterName)
top of page

Syntax note and examples

  1. SYNTAX NOTE
  2. FilterName: The name of the filter as given when the filter was created.
  3. List separator: When typing a formula, make sure you separate its arguments 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.Area(m; Plotting); n2$ $Layout1.Area(m, Plotting), n2$

The following examples demonstrate how the arguments work.

Filter Name Drawing Function
Circles15 Specified by User-Defined Name "Body".CountByFilter(Circles15)
Arcs>20 Specified by System Name Layout1.CountByFilter(Arcs>20)
Circles>105 Active CountByFilter(Circles>105)
top of page