Using the Macro Recorder to Capture Commands

Published on October 12, 2011

The MicroStation VBA Macro Recorder is a useful tool beyond just capturing workflows for creating your own macros. A common dilemma for users wanting to create Batch Process scripts, or their own custom toolboxes is knowing the key-in commands they need for the task they want to accomplish. Using the Macro Recorder to capture the necessary commands in a vba macro can provide the key-in entries required for both applications. The command in double quotes after the CadInputQueue.SendCommand statement can be copied and pasted into a Batch Processor script, or used for the Key-in entry for a custom toolbox button.

Sample MicroStation commands captured using the VBA Macro Recorder


Sub Macro1()
Dim startPoint As Point3d
Dim point As Point3d, point2 As Point3d
Dim lngTemp As Long

‘ Start a command
CadInputQueue.SendCommand “CHOOSE ALL”

CadInputQueue.SendCommand “CHOOSE NONE”

CadInputQueue.SendCommand “PLACE DIALOGTEXT ICON”

CommandState.StartDefaultCommand
End Sub

Copy and pasting a command into a Batch Process script file

CAD Training

Copying a command key-in to create a custom toolbox button.


Tags:
Like this article? Share it!

One Response to “Using the Macro Recorder to Capture Commands”

  1. Envision Newsletter October 2011 | Envision CAD | MicroStation Training & InRoads Training Says:

    November 23rd, 2011 at 12:53 pm

    […] VBA: Using the Macro Recorder to Capture Commands […]

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Privacy Policy