When I run the following macro it works as expected. When I close this
dgn file and open a new dgn file without exiting MicroStation and run
the macro again it waits for the user to input a tag value for fuseno.
When I exit MicroStation completely and enter MicroStation again the
macro works as expected.
Please HELP!
Macro:
Sub main
Dim startPoint As MbePoint
Dim point As MbePoint, point2 As MbePoint
' Start a command
MbeSendCommand "PLACE CIRCLE ICON "
' Coordinates are in master units
startPoint.x = 2038.750000#
startPoint.y = -3704766.310000#
startPoint.z = 0.000000#
' Send a data point to the current command
point.x = startPoint.x
point.y = startPoint.y
point.z = startPoint.z
MbeSendDataPoint point, 1%
point.x = startPoint.x + 55.240000#
point.y = startPoint.y - 46.710000#
point.z = startPoint.z
MbeSendDataPoint point, 1%
MbeSendCommand "Attach Tags "
' Send a keyin that can be a command string
MbeSendKeyin "TAGJOURNAL ATTACH SET fuseno"
point.x = startPoint.x + 63.740000#
point.y = startPoint.y - 33.970000#
point.z = startPoint.z
MbeSendDataPoint point, 1%
point.x = startPoint.x + 293.200000#
point.y = startPoint.y
point.z = startPoint.z
MbeSendDataPoint point, 1%
MbeSendKeyin "TAGJOURNAL ATTACH TAG fuseno"
' When a command brings up a modal dialog,
' a later statement must close the dialog,
' or the MbeState.modalDialogByUser property
' should be set to 1 so that the user must close
' the dialog when the macro is executed.
' Also, you may not use the de* "Step"
' commands while a modal dialog is displayed.
' Opened modal dialog "Attach Tags [fuseno]"
MbeSendKeyin "TAGJOURNAL ATTACH VALUE 1234"
MbeSendKeyin "TAGJOURNAL ATTACH VALUE 1234"
' Closed modal dialog "Attach Tags [fuseno]"
' Following comment is the command to close a modal dialog
MbeSendCommand "MBE1 CLOSEMODAL OK"
point.x = startPoint.x + 118.980000#
point.y = startPoint.y
point.z = startPoint.z
MbeSendDataPoint point, 1%
End Sub