Using the Search Language

You can use the search language to search for objects. The search language offers almost all the search functions available with the Find... command and you can use the same criteria. The KeyboardInput.CATNls message catalog defines the search syntax for the power input and search language shortcuts. The localized version of this message catalog determines the exact syntax and shortcuts for each language.

The search language uses the following separators: != (different), <, <=, >, =>, : and = (these two separators are interchangeable).

The stages in this procedure are as follows:

Run a Search through the Power Input Box

The search language can be used both in the power input box and in the Advanced tab of the Find dialog box but also in macros. The search query both searches for the elements and automatically selects them. Searching using the Find... command generates a search query (expressed in the search language) displayed in the Generated query box of the Find dialog box.

You can run any generated query through the power input box or in macros, whether transformat or not. However, the transformat query is the only usable query whatever the session language: any query you expect to run in different session languages must be in this format. If you are not familiar with it, you can display its contents and identify the syntax to use. To do so, drag the column separator next to the Query column to display it in the Favorites tab of the Find dialog box.

For example, CATDrwSearch.DrwText.Name=test,in means that you search for objects named "test" in the Drafting apps using the "In <UI-Active object>" scope.

  1. Enter the search string.
  2. Press Enter.

The searched objects are sent to the current command. For example, if the current command is Select, the objects are selected.

The language to be used when entering your query is detailed below.

Search by Name

You can search for an object name. This is particularly useful if you renamed objects using the Properties contextual command. The name can also contain special characters.

To search for an object by its name, enter the following command:

name:object_name or name=object_name

or a command using an abbreviation referred to as a "shortcut" as follows:

n:object_name

where "object_name" is the name of the object.

You can also use the "*" character as a wildcard to replace any number of characters. For example, the command:

name:wheel*

searches for all objects starting with the string "wheel".

The message catalog KeyboardInput.CATNls defines unambiguous default shortcuts. For example, there is no ambiguity between the shortcut c: (used in the power input area to enter a command), and col: (used for searches on color). In localized versions of the catalog, make sure that there are no identical shortcuts for two different items.

If you want the search to be case-sensitive, enter the following command:

NAME:Wheel*

searches for all objects starting with the string "Wheel".

Important: The keyword used for queries that are not case-sensitive is always in lowercase whereas for case-sensitive queries, the keyword is in uppercase. For languages that do not make any difference between uppercase and lowercase characters, you can add the string _CAP to the keyword to specify that the query is case-sensitive. You can also use the Name_CAP transformat keyword.

Search by Name in Tree

You can search for an object name. This search is different from a search by name since it deals with the name as is displayed in the tree.

To search for an object by its name as displayed in the tree, enter the following command:

name in tree=object_name

If you want the search to be case-sensitive, enter the following command:

NAME IN TREE=object_name

This name may be customized and thus, may differ from the name you entered in the Properties dialog box.

Note: The tree item size defined in the Tree Appearance tab is not taken into account.

Search by Type

You can use the Type box in the Find dialog box to display a list of types (the types are translated in each language).

To search for an object by its type, enter the following command:

type:type or type=type

or

t:type

You can also search for types using the "." (period) as follows:

Part Design.Pad

searches for all objects of type Pad created using Part Design.

You can also use the following syntax:

app.type.attribute=

For example, entering:

Part Design.Pad.Color=Sea Green

searches for all objects of type Pad created using Part Design, and of the color Sea Green.

You can omit the app name if the type exists only for this app:

Part Design.Pad and .Pad are equivalent.

Similarly:

Part Design.Pad.Color=Sea Green and type=Pad & Color=Sea Green are also equivalent.

Here are some more examples using the other operators described in Search Using Operators:

app.type.name=point*

app.type.name!=point*

app.type.name:point*

and:

app.type.color='sea green'

app.type.color!='sea green'

app.type.color:'sea green'

Search by Color

You assign colors to objects using the Color list in the Graphic tab, when using the Properties contextual command.

For a reminder about how to use this list, see Editing Graphic Properties.

To search for an object of a specific color, enter the following command:

color:color_name or col:color_name

where "color_name" is the color of the object.

If the name of the color contains a blank (which is the case with most of the colors available), you can type the full name as follows:

color:Sandy Brown

You can also surround the blank or the color name with a single quote (by default) like this:

color:Sandy' 'Brown or color:'Sandy Brown'

You can also search for colors using their RGB values. For example:

color:'(211,178,125)'

In addition to this, each color displayed in the Color list or in the color palette is identified by an index in the color table. For example, when searching for the "Salmon" color, you can enter either:

col:Salmon or col:17

since "Salmon" is the 17th color in the color palette.

Search by Product Properties

You assign properties to products (and parts in products) by right-clicking an element in the tree and selecting Properties. Or, you can click the Product tab in the Properties dialog box, and then specify the properties in the Product frame.

The properties you can search for (the same as those you assigned to the element) are:

  • Part Number
  • Revision
  • Definition
  • Nomenclature
  • Product Description
  • Component Description.

For example, the following search queries search for all elements whose Product Description is the text "completed":

Product Description:completed

Product' 'Description:completed

'Product Description':completed

'Product Description'=completed

The property name is case-sensitive.

Search for Objects Belonging to a Layer or a Selection Set

You can search for an object belonging to a specific layer (as seen in the Object Properties panel) or to a selection set.

To do so, enter the following command:

l:layer_number or l=layer_number

or

layer:layer_number or layer=layer_number

where "layer_number" is the number of the layer.

To search for an object belonging to a selection set, enter the following command:

s:selection_set_name or set:selection_set_name

where "selection_set_name" is the name of the selection set.

If you want the search to be case-sensitive, enter the following command:

SET=selection_set_name

The strings "name", "type", "color" and "set" are appropriate for the English language only. The message catalog KeyboardInput.CATNls determines the exact syntax for your language.

Search for Line Thickness or Linetype

You can search for objects with a specific line thickness or linetype (as seen in the Object Properties panel).

To do so, use the following syntax:

weight: or w:

dashed: or d:

When searching for lines with a specific weight, you can specify the weight index like this:

weight:6,all

to search for all lines that are 2.0000 mm thick.

Search for Visible or Hidden Elements

You can search for visible, invisible, shown elements, or elements hidden in the No Show space.

To do so, use the following syntax:

visibility:visible or vis:visible

and:

visibility:hidden or vis:hidden

Search by Symbol

You can search for a point symbol.

To do so, enter the following command:

symbol:small full square or symbol=small full square

or

symb:small full square or symb=small full square

searches for the following point symbol: . The item that is searched for is the Point Symbol property defined in the graphic properties of the object.

Capital letters are meaningless for the symbol name and you can also type:

symbol:Small Full Square or symbol=SMALL FULL SQUARE

Below are the point symbols you can search for:



Cross
Plus
Circle
Double Circle
Dot
Full Square
Star
Small Full Square
Small Dot

Search Using Favorites

You can search for objects using your favorite queries defined by the Favorites tab in the Find dialog box.

To do so:

favorite=favorite_query_name or favorite:favorite_query_name

but you can also enter:

f=favorite_query_name or f:favorite_query_name

where "favorite_query_name" is the name of the favorite query. Note that the language used in favorite queries is case-sensitive.

When you press Enter, the search results are highlighted in the tree.

You can use any of the special characters such as !. For example, let us use the query defined in the Favorites tab. This query searches for any element named "My Sketch". If you want your search to select all elements whose names are other than "My Sketch", type:

favorite!=Query_1 or f!=Query_1

In that case, this does not modify the search scope.

To modify the search scope, indicate the new scope after the favorite query name in the power input box:

favorite=Query_1, from

searches for any element named "My Sketch" From Search to bottom and not Everywhere as originally defined in Query_1. The new scope supersedes the previous one.

You can also combine favorite queries with predefined favorite queries using operators.

Search Using Predefined Favorites

You can search for objects using predefined favorite queries that you run by entering specific shortcuts. You cannot modify or delete these predefined favorite queries (that do not deal with V5 objects). Contrary to the standard favorite queries you define in the Favorites tab of the Find dialog box.

The shortcuts used to run these predefined queries search "Everywhere". But if you choose scr as Visible on screen option and Replaces scope defined in favorite queries in the Default Search Scope for Power Input area, then the queries search for visible elements only.

You can use the following shortcuts:

Shortcut Corresponds to... Searches for...
* t:*,all All objects everywhere (that is, in the whole tree from top to bottom).
*PLN .Plane,all All planes everywhere.
*SUR .Surface-.Plane,all All surfaces (except planes) everywhere.
*FAC .Face,all All topological faces everywhere.
*VOL .Volume,all All volumes everywhere.
*LN .Line-.Sketcher.Line,all All lines (except Sketcher's) everywhere.
*PT .Point-.Sketcher.Point,all All points (except Sketcher's) everywhere.
*CRV .Curve-.Line-.Sketcher.Curve,all All curves (except Sketcher's and lines) everywhere.
*SKT .Sketch,all All sketches everywhere.
*AXS .Axis System+.AbsoluteAxis,all All axis systems (including Sketcher's) everywhere.
*FTA .Functional Tolerancing & Annotation Element All Functional Tolerancing & Annotation elements everywhere.

For example, to search for all sketches everywhere, enter the appropriate shortcut after the prefix used to run favorite queries:

f:*SKT or f=*SKT

but you can also enter

favorite:*SKT or favorite=*SKT

Tip: If the option f: as favorite: is specified in the Default Prefix for Power Input list, you do not need to type the prefix before the shortcut. You enter *SKT to search for all sketches everywhere.

Predefined shortcuts are available to search for elements having a characteristic in common with the element you select:

Shortcut Searches for...
*COL All objects with the same color as the selected object.
*LAY All objects included in the same layer as the selected object.
*LNW All lines with the same thickness as the selected object.
*LNT All lines with the same linetype as the selected object.
*PTT All points with the same point type as the selected object.
*PRT All objects included in the same part as the selected object.
*PBD All objects included in the same part body (or hybrid body) as the selected object.
*GST All objects included in the same geometrical set as the selected object.
*OGS All objects included in the same ordered geometrical set as the selected object.

To run a predefined favorite query involving a selection, you need to select the object before or after entering the appropriate shortcut.

For example, to search for all objects with the same color as the selected object ("blue" in our example), select a "blue" object then enter:

*COL

or enter *COL, and then select the object. In that case, when you press Enter after entering the shortcut is entered, an acquisition agent opens: select the object then click Close to close the acquisition agent.

You can run predefined favorite queries with arguments. To run these predefined queries, use the following shortcuts:

Shortcut Corresponds to... Searches for...
*COL< xxx > Color= xxx ,all All elements with the color xxx everywhere, where xxx is the RGB code (for example, *COL'(0,0,255)' when searching for the "blue" color), or the color name (for example, *COLblue), or the color index (for example, *COL45).
*SST< xxx > Set= xxx ,all All objects in the selection set xxx everywhere (where xxx is the name of the set, for example, *SST'Set1' or SSTSet1).
*LAY< n > Layer= n ,all All objects in the layer n everywhere (where n is the layer number, for example, *LAY2).
*LNW< n > .Line & Weight= n ,all All lines drawn with the thickness index n, as displayed in the Weight list of the Search dialog box, everywhere (for example, *LNW3 to search for a 0.7000 mm line: ).
*LNT< n > .Line & Dashed= n ,all All lines drawn with the dashed index n, as displayed in the Dashed list of the Search dialog box, everywhere (for example, *LNT2 to search for a "Dotted" line: ).
*PTT< n > .Point & Symbol= n ,all All points drawn with the symbol n, as displayed in the Symbol list of the Search dialog box, everywhere (for example, *PTT8 to search for the eighth symbol in the list, from top to bottom: ).

For example, to search for all lines of type "Dotted" everywhere, enter the appropriate shortcut after the prefix used to run favorite queries:

f:*LNT2 or f=*LNT2

but you can also enter

favorite:*LNT2 or favorite=*LNT2

Tip: If you select f: as favorite: in the Default Prefix for Power Input list, you do not need to type the prefix before the shortcut. You enter: *LNT2 to search for all lines of type "Dotted" everywhere.

Search Using Special Characters

Characters & + - ( ) have a special importance in the search syntax. The syntax interprets them in names, provided that you surround those characters or text strings containing those characters by the character ' (apostrophe by default).

For example:

n:*')' searches for all names ending with )

n:*'&' searches for all names containing &

n:*'(1)' searches for all names ending with (1).

The following line in the KeyboardInput.CATNls resource file :

Quote = " ' ";

specifies the default character for surrounding strings.

The character * is always interpreted as a wild card except if surrounded by two characters '.

For example:

n:*''*'' searches for all names ending with *

n:*''*''* searches for all names containing *

n:*'&'''*''* searches for all names containing &*

n:'*)' searches for all names ending with ). This is identical to n:*')'

You must double the character ' twice to make it interpreted literally.

For example:

n:*''''* searches for all names containing a '

n:P''''* searches for all names beginning with P'

n:P''''''''* searches for all names beginning with P''

Search Using Operators

You can use operators to combine the standard queries.

The supported operators are: &, +, and - (for AND, OR and EXCEPT respectively) and ( ).

Blanks are not considered as separators. You can surround them by ', but this is not mandatory.

You can combine the standard queries as follows:

name:*wheel'&'door&type:Part

name:*wheel'&'door & type:Part

name:*'wheel&door' & type:Part

name:*'wheel&door'& type:Part

name:*wheel'&'door &type:Part

they all search for parts whose names end with "wheel&door".

The command:

name:wheel1 + name:wheel2

searches for objects named "wheel1" and objects named "wheel2".

Before you start, note the following information:

  • If you do not specify any search scope when entering your query, the scope used is either:

    • the scope defined in the Default Search Scope for Power Input list.
    • or, the scope of the predefined favorite query or of the favorite query (provided that the Replaces scope defined in favorite queries option is not selected. Otherwise, the scope defined in the Default Search Scope for Power Input list prevails).

  • If you specified a default prefix in the Default Prefix for Power Input list, you do not need to type it in the power input box. For example, if you specified f: as the default prefix, enter *LN+*PT instead of f:*LN+f:*PT.
  • If at least one shortcut in the query requires a selection, you must select an object before or after running the query. If there is more than one shortcut requiring a selection, then you must select only one object. The query then uses the properties of the selected object all the shortcuts involved in the query.

You can combine predefined favorite queries:

Let us suppose you want to search for all lines or all points. You enter:

f:*LN+*PT

but you can also use any other favorite prefix (f=, favorite: or favorite=).

This query searches for all lines and points everywhere because you have not specified a scope. Besides, as explained above, the search uses the scope of the predefined query.

To use another search scope, specify it after the query. For example, to search for all lines and points visible on screen, specify scr as Visible on screen as the default scope in the Default Search Scope for Power Input list. Do not forget to select the Replaces scope defined in favorite queries option as well.

But you can also enter:

f:*LN+*PT, scr

You can combine predefined favorite queries, favorite queries, and standard queries:

Let us suppose a favorite query named "Query_1" (which searches for all elements whose color is "black"): to search for all lines and whose color is black or whose name ends with "3", you enter:

f:*LN&(Query_1+n:*3) or f:*LN&(Query_1+name:*3)

but you can also use any other favorite prefix (f=, favorite: or favorite=).

Priority

There is no priority among operators, but there is a priority in their order of appearance (from left to right).

For example, the query:

type:Part* & name:toto + type:Hole & Color:Black

is interpreted as:

type:Part* & (name:toto + (type:Hole & Color:Black) )

and thus searches for elements of type "Part" among the objects in the document that are "black holes" or named "toto".

To avoid ambiguity, use parentheses like this to obtain the same result:

type:Part* & (name:toto + (type:Hole & Color:Black) )

Search Using Search Scopes

You can use the same search scopes as with the Find... command (except From search results that is only available in the Find dialog box), by using the following context aliases: all, in, from, sel and scr.

  • all: searches the whole tree from top to bottom, to find objects created using all apps.
  • in: locates the appropriate elements in the active object and in the app you are using.
  • from: searches the elements in the active object to the bottom of the tree. For example, in a Part document, it searches both parts and sketches.
  • sel: if you already selected objects before running the Find... command, this option searches from the selected objects to the bottom of the tree.
  • scr: searches for objects visible in the current tab. It does not search for elements that are unactivated or invisible in the 3D area. For example, elements transferred to the No Show space, elements that are not in the current filter or not in the current mask, or features used to build other features that appear in the tree but not in the 3D.

The default is in. Always place scope aliases at the end of the search string, and after the separator "," like this:

type:Hole, all

The separator is the comma (",") for the English, Japanese, Korean, and simplified Chinese environments, and the semicolon (";") for all other supported environments.

Search Using a Default Prefix

A prefix is required to run a command or a query through the power input box. One prefix (c:) is already provided to run commands, and you can use several prefixes for search queries.

When searching for a name, for example, you must prefix the value by n: or with name:, for example, n:wheel.

By default, no default prefix is defined. But if you use a default prefix, this avoids specifying the prefix when entering your query in the power input box: only enter the search string. The default prefix is defined in the Status Bar - Find section that provides a list of predefined prefixes.

Suppose you select the prefix n: as name: in the Default Prefix for Power Input list then in the power input box, you enter only the name you are searching for such as:

wheel

to search for objects named "wheel".

Search Using a Default Search Scope

You can use a default search scope to avoid specifying the scope in the power input box. The default scope is in when running a query in the power input box.

If you do not enter a scope alias at the end of the search string, the search locates the appropriate elements in the active object, and in the app you are using.

The default search scope is defined in the Status Bar - Find section that provides a list of predefined search scopes.

For example, if the scope all as Everywhere is specified in the Default Search Scope for Power Input list, enter:

type:Hole instead of type:Hole, all

to search for objects of type "Hole" in the whole tree from top to bottom.