Using the Macro Recorder to Capture Commands

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.

EnvisionCAD

Since 1996, EnvisionCAD has been a nationally recognized leader in the configuration, customization, implementation, training & support for CAD software solutions. Our individualized approach has benefited private engineering firms and government agencies alike. Basic or advanced, we can help you get the most from your CAD technology.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *