Unable to zoom with mouse wheel with keyin strings requiring data points

MicroStation V8 XM Edition

This is where you can find and contribute to discussions, ideas, and other information about MicroStation V8 XM Edition.

Unable to zoom with mouse wheel with keyin strings requiring data points

  • rated by 0 members
  • This post has 3 Replies |
  • 2 Followers
  • Yes, point ab is short for point absolute.

    Placing the commands into a BASIC macro results in the following which seems to work fine as per the attached video.

    Please note that this macro is very inefficient and does not allow you to easily reset, or cancel, out of it.  To do that, it'll need to be re-written by someone who knows programming.  I just dabble and it shows in my results.  :-)

     

    Sub main 
        Dim startPoint As MbePoint
        Dim point As MbePoint, point2 As MbePoint
    '   Send a keyin that can be a command string
        MbeSendKeyin "choose element"
        MbeSendKeyin "powerselector area block"
        MbeSendKeyin "%d"
        MbeSendKeyin "%d"
        MbeSendKeyin "set displayset on"
        MbeSendKeyin "point absolute"
        MbeSendKeyin "displayset set selection"
        MbeSendKeyin "fit all"
        MbeSendKeyin "point absolute"
        MbeSendKeyin "displayset clear"
        MbeSendKeyin "choose none"
        MbeSendKeyin "update view extended"
        MbeSendKeyin "point absolute"
        MbeSendKeyin "place fence"
        MbeSendKeyin "%d"
        MbeSendKeyin "%d"
        MbeSendKeyin "reference clip"
        MbeSetAppVariable "", "tcb->msToolSettings.refTools.clipMethod", 0&, 15&
        MbeSendKeyin "%d"
        MbeSendKeyin "%d"
        MbeSendKeyin "choose element"
        MbeSendKeyin "powerselector single"
        MbeSendKeyin "point absolute"
    End Sub

    Click here to play this video

     

  • Inga,

    Thanks, but it didn't  work. What is the "point ab" for? Should that be "point absolute"?

    Also, I recorded a macro for my original attempt at the keyin script. I don't know enough about BASIC to know what to change to get it to work the way I would like it to. Here is what I get from BASIC editor:

    Sub main

       Dim startPoint As MbePoint

       Dim point As MbePoint, point2 As MbePoint

    '   Start a command

       MbeSendCommand "ACCUDRAW RUN "

    '   Send a keyin that can be a command string

       MbeSendKeyin "MACRO SHORTCUT SHORTCUT;PLACE FENCE;%d;%d;REFERENCE CLIP"

    '   Coordinates are in master units

       startPoint.x = -108.057114#

       startPoint.y = 75.661790#

       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 + 31.682185#

       point.y = startPoint.y - 38.691875#

       point.z = startPoint.z

       MbeSendDataPoint point, 1%

       point.x = startPoint.x + 13.980104#

       point.y = startPoint.y - 10.444990#

       point.z = startPoint.z

       MbeSendDataPoint point, 1%

    '   Send a reset to the current command

       MbeSendReset

    End Sub

  • As you've discovered, key-in scripts are a bit restrictive - even primitive in the way they work.  They don't support the type of  user interaction you're needing.  For that, you'll probably need a VBA or macro.

    However, having said that, the following might work. It's a bit of a twist on what you were trying.

    Create a selection set of the elements (ie: area) you want to zoom to.

    Turn on display set for the view

    Set the displayset to the current display set

    Fit the selection set to the view

    Clear the display set

    Clear the selection set

    Update the view

    Place the fence block

     

    The entire keyin is as follows and seems to work fine in MS XM.

    choose element;powerselector area block;%d;%d;set displayset on;point ab;displayset set selection;fit all;point ab;displayset clear;choose none;update view extended;point ab;place fence;%d;%d;reference clip;%d;%d;choose element;powerselector single;point ab

     

    You might want to add choose element;powerselector single  on the end to set you back to the element Selection tool.

     

  • I created a keyin to place a fence and then clip a reference. Here's what it looks like:

    PLACE FENCE;%D;%D;REFERENCE CLIP

    The problem I have is if I'm not zoomed to where I want then I have to exit the command and zoom in or out. I got around this a little bit, by adding a zoom keyin to the beginning of this, but it still becomes a problem if I don't get that right (such as if I start too close or too far away from what I'm trying to target). Here's what that looks like:

    WINDOW AREA EXTENDED;%D;%D;PLACE FENCE;%D;%D;REFERENCE CLIP

    Is there a way to run "Place Fence" where I can zoom with the mouse wheel and place as many points as I want (clip with shape instead of rectangle) and then go into "Reference Clip" after I get done with placing my fence?

Page 1 of 1 (4 items)