Macro V7

Discussion in 'Microstation' started by PP1, Dec 12, 2003.

  1. PP1

    PP1 Guest

    Hey,

    I'm trying to make a very simple macro.
    But there are 2 things I don't seam to get right:

    1.
    The following macro places the text "Dh".

    Sub main
    Dim startPoint As MbePoint
    Dim point As MbePoint, point2 As MbePoint

    MbeSendKeyin "place text;Dh"
    MbeSendKeyin Chr$(27)

    End Sub

    The problem is that the MicroStation Keyin gives the command "TEXT:"
    I have to press the [Esc] button to make this go away.

    How can I let the macro finish (after reset) with a blank Keyin???


    2.
    I've got the same macro as above that should place the text "E".
    But MicroStation doesn't know wat to do!
    When I give the command (as a Keyin) "place text;E" Microstation
    notives me that "Command not defined for this application".


    Can anybody help me with this?

    Thanks.



    Peter
     
    PP1, Dec 12, 2003
    #1
  2. PP1

    Who Me? Guest

    Sub main
    Dim txtInput As String

    ' GET THE TEXT FROM THE USER
    txtInput = MbeInputBox ("Type in some text you want to
    place.","Dh","What Text?")

    ' PLACE THE TEXT ON THE CURSOR
    MbeSendKeyin "PLACE TEXT"
    MbeSendCommand "Place dialogText Icon"
    MbeSendAppMessage "textEdit", "firstLine " & txtInput

    ' WAIT FOR USER INPUT TO PLACE THE TEXT
    ' IF A DATA POINT THEN PLACE THE TEXT
    ' OTHERWISE END THE MACRO
    mbeGetInput mbe_datapointinput, mbe_resetinput
    If mbestate.inputtype = Mbe_DataPointInput Then
    MbeSendLastInput
    Else
    MbeStartDefaultCommand : End
    End If

    End Sub

    --
    perl -e '$_ = "macart\@No_Ozemail.SPAM.com.au\n"; s/NO\.//; s/SPAM\.//;
    print;'
    | Hey,
    |
    | I'm trying to make a very simple macro.
    | But there are 2 things I don't seam to get right:
    |
    | 1.
    | The following macro places the text "Dh".
    |
    | Sub main
    | Dim startPoint As MbePoint
    | Dim point As MbePoint, point2 As MbePoint
    |
    | MbeSendKeyin "place text;Dh"
    | MbeSendKeyin Chr$(27)
    |
    | End Sub
    |
    | The problem is that the MicroStation Keyin gives the command "TEXT:"
    | I have to press the [Esc] button to make this go away.
    |
    | How can I let the macro finish (after reset) with a blank Keyin???
    |
    |
    | 2.
    | I've got the same macro as above that should place the text "E".
    | But MicroStation doesn't know wat to do!
    | When I give the command (as a Keyin) "place text;E" Microstation
    | notives me that "Command not defined for this application".
    |
    |
    | Can anybody help me with this?
    |
    | Thanks.
    |
    |
    |
    | Peter
     
    Who Me?, Dec 12, 2003
    #2
  3. This problem exist because after placing Dh text, "place text" command is still active.
    Please choose other tool in end of macro - default selection tool for example:

    Sub main
    MbeSendKeyin "place text;Dh;%d"
    MbeStartDefaultCommand
    End Sub
    Text that matches a MicroStation command is interpreted as a command if parsing is on. Parsing is set with the key-in, SET PARSEALL
    more info:
    http://docs.bentley.com/pl/MicroStation/ustnhelp1749.html#F37504

    Regards
    Krzysztof
     
    Krzysztof Trzaskulski, Dec 12, 2003
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.