STEM help

4.21.2 Replacing text in views and data dialogs

A Replace function was added in STEM 7.5 to complement the Find functionality; this enables you to modify all of the things you could previously just find! The most common use of this functionality is likely to be modification of element names, as described below.

Using Find and replace

In a particular model, you may wish to make a wholesale change to several elements with a common naming theme (e.g., you may wish to replace Access in the names of several elements with Transport). Note that the Editor will not allow you to replace text if, for example, it would result in an element name that is no longer unique.

  1. Select the elements whose names you want to change.
  2. Select Find and Replace from the main Edit menu (or press <Ctrl + H>). The Find and Replace dialog is displayed.
  3. Type ‘access’ in the Find what box and ‘transport’ into the Replace with box.

Figure 1: Using the Find and Replace dialog to change element names

  1. Press the Find Next button.
  2. The dialog shows a list of matches for the text ‘access’ found in the names of the selected elements.

Figure 2: Matches identified using the Find and replace functionality

  1. Pressing Replace changes ‘Access’ in the first text match to ‘Transport’. STEM then moves to the next matched item in the list. Alternatively, you can select each item in the list individually and choose to press Replace. Another alternative is to Replace All, such that the text is changed for all matches in a single transaction.

Figure 3: Updated element names using Find and replace

The replacement logic is intelligent where upper/lower case is concerned: if the original element text is ‘Access chassis’ (upper case ‘A’), then the resulting element name is ‘Transport chassis’. Likewise, ‘No of access cards’ (lower case ‘a’) is changed to ‘Number of transport cards’. If Match case is selected in the dialog, then text is only matched if it is the same case as what you have typed; i.e., if you type ‘Access’ in the Find what box with Match case selected, STEM only matches element names that contain the exact text ‘Access’ (leading capital), and will ignore element names only containing the text ‘access’ (all lower case).

A similar process can be undertaken for finding and replacing text and values in text boxes, data dialogs, views, formulae and notes. The Editor will not allow you to make changes in formulae if it would lead to a formula that is no longer viable.


       Buy SSL

© Implied Logic Limited