Skip to main content

Select Shapes by Reference Node (Shapes > Select)

What it does

This node allows you to select specific shapes in your document based on reference items. The selected shapes can then be used as input for further processing in your Data Flow.

Use it for

  • Selecting shapes based on reference items in your document.
  • Selecting shapes using expressions that compare their properties to those of the reference.

Examples include:

  • Selecting shapes inside or outside the area of the reference.
  • Selecting shapes within a specific distance from the reference.
  • Selecting shapes that share similar properties with the reference (e.g., type, font, position).

How to use it

  1. Drag and drop the node from the Node Library into your template:
    Node Library > Folder Shapes > Folder Select
  2. Connect a node from the Data Flow to the input port as the reference.
  3. Specify the settings in the Node Properties task pane. Define a Filter Expression to select shapes based on the reference.
  4. Connect the node's output port to other nodes in the Data Flow.

Node Input

Connect a node containing the items you want to use as reference for selection to the References input port.

Node Output

Outputs a list of shapes that match the criteria defined in the Filter Expression in the Selected Shapes output port.

Node Properties

Node Name

You can assign a custom name to the node to help identify its purpose within your template.


Shape Name

You can assign a custom name to the selected shapes to help identify them in further shape trees.


Filter matches

Specify whether the Filter Expression must match at least one reference or all references in the input list for the filter to apply.

  • At least one reference: the Filter Expression must match any reference
  • All references – the Filter Expression must match every reference

Filter Expression

Enter an expression to define which shapes to select in your document based on the reference items. For more details, see the articles in the Expression Language section.

Available variables:

  • shape: the current shape being processed. Read more about available properties in Objects and properties.
  • reference: the reference item from the References input list. reference has the same properties as a shape tree object.

Expected return type: boolean

Example 1: Select shapes by font and position within references

shape.font.name = "Courier New" and 
shape.docBBox inside reference.docBBox

Selects all text shapes with the font "Courier New" whose document bounding boxes lie completely inside the bounding box of the reference items.

Example 2: Select shapes located outside reference boundaries

Important: If multiple reference items are connected and you want to ensure that filtered items are outside all of them, set Filter matches to All references.

shape.docBBox not inside shape.docBBox

Selects shapes that are located outside the boundaries of the reference items. This is useful, for example, for extracting text that lies outside elements such as tables or text boxes, where the layout structure is provided via the References input.

Example 3: Select shapes by vertical distance to references

(shape.top _ reference.bottom) < 4

Selects all shapes where the distance from their top edge to the bottom edge of the reference is less than 4 points.

Example 4: Select image shapes positioned to the right of references

shape.type = "image" and 
shape.left > reference.right

Selects all image shapes that are positioned to the right of the reference items, based on their left and right edge coordinates.