Find Replace Text with Batch Process


 Product:MicroStation
 Version:V8i, CONNECT
 Environment:N\A
 Area:Text
 Subarea:Find / Replace Text

Globally Find and Replace Text in numerous files with the Batch Process Utility

Background

Whether you need to update pieces of text or Tags, using the Batch Processor and the Find/Replace Text tool this can be accomplished.  Also, be sure to note the initial Key In string that contains the word SILENT so that the OK Button does not force you to manually interact with each file being processed.

Steps to Accomplish

Option 1 Batch Process

  1. Using the Batch Process as described in the Help File (Help > Contents > Menus > Utilities > Batch Process
  2. When creating the Command file use these lines:
    MDL SILENTLOAD FINDREPLACETEXT,CHNGTXT CHANGE DIALOGTEXT
    FIND DIALOG SEARCHSTRING old
    FIND DIALOG REPLACESTRING new
    CHANGE TEXT ALLFILTERED

Option 2 Macro

  1. If desired, VBA can be used
  2. Here is an example

Option Explicit

Public Sub FindReplace(findStr, repStr)
    Dim tmpStr
    
    CadInputQueue.SendCommand "MDL SILENTLOAD FINDREPLACETEXT,CHNGTXT CHANGE DIALOGTEXT"
    tmpStr = "FIND DIALOG SEARCHSTRING " + findStr + "; FIND DIALOG REPLACESTRING " + repStr
    
    CadInputQueue.SendKeyin tmpStr
    CadInputQueue.SendKeyin "CHANGE TEXT ALLFILTERED"
End Sub

Sub main()
    FindReplace "119.00m", "119.20m"
End Sub

See also

MVBA-FAQ

Other language sources

 Original Author:Daniel Koval