Managing Usability

by Mark Stefanchuk, CADmanage.com

[Update: Be sure to check out Kim’s comment – a great alternative using the F1 key and choose none. Thanks Kim!]

I’ve been debating whether or not to share this with my MicroStation peeps. I hesitate because I don’t like to admit that sometimes I don’t adjust to change as quickly as I should, but also because this example has some conflict with features in MicroStation V8i that we wouldn’t introduce normally, especially if we don’t have to. What am I talking about?

Earlier this year I was working with a client helping them upgrade from MicroStation 2004 to V8i SS2. Not as big of a jump from V7 to V8, but big enough. Things were missing and commands didn’t work the same way. Years ago we could rely on commands that were in the previous version to work the same way in the new version. Today, it’s not that way. And seriously, there are good reasons for change, like productivity gains. I’m all for that. In this case however, it was clear that the user base missed some of the key operations that made MicroStation, well MicroStation and not AutoCAD.

For example, in older versions of MicroStation when you were done with a selection created using power selector you would use the right mouse button to deselect (reset). In V8i you just use the right mouse button (a datapoint in the view). That’s seems pretty easy. But if you have been drafting for years using the same workflow not being able to use something so simple as the reset button to deselect a selection set can be really frustrating.

Now, I was the consultant and I really wanted my client to be happy so I fixed it. I built an MDL application that would watch for reset. When the user clicks reset any active selection set would be removed. The command is very primitive, but I thought I would share in case you might have a similar issue. There’s not much to it – comments below.

#include    <mdl.h> 
#include    <tcb.h> 
#include    <dlogitem.h> 
#include    <dlogids.h> 
#include    <rscdefs.h> 
#include    <mdlerrs.h> 
#include    <userfnc.h> 
#include    <global.h> 
#include    <mselems.h> 
#include    <accudraw.h> 
#include    <cexpr.h> 
#include    <math.h> 
#include    <string.h>

#include    "ps_resetcmd.h" 
#include    "ps_reset.h" 
#include    "fdf.fdf"

int goFlag; // a flag to watch for active commands that might conflict
// the event watcher
Private int monitorQueue ( Inputq_element *queueElementP ) 
{     
    char sCmd[256];         
    sprintf(sCmd, "%S", mdlState_getCurrentCommandName());     

    // Element Selection Active     
    if (strcmp(sCmd, "Element Selection") == 0)
    {
        goFlag = 0;  
    }

    // a quick a dirty way to watch for active command - be careful with upgrades because this might not be
    // supported in the future. - not very elegant but it works - I'm a little bull headed that way.
    if ((strcmp(sCmd, "Dimension Element") == 0) || (strcmp(sCmd, "Dimension Linear Size") == 0) 
        ||   (strcmp(sCmd, "Dimension Angle Size") == 0) || (strcmp(sCmd, "Dimension Ordinates") == 0) 
        ||   (strcmp(sCmd, "Change Dimension") == 0) ||   (strcmp(sCmd, "Drop Dimension Element") == 0)
        ||   (strcmp(sCmd, "Dimension Size Perpendicular to Points") == 0) ||   (strcmp(sCmd, "Dimension Diameter") == 0) 
        ||   (strcmp(sCmd, "Label Point Coordinate") == 0) || (strcmp(sCmd, "Dimension Symmetric") == 0) 
        ||   (strcmp(sCmd, "Dimension Half") == 0) || (strcmp(sCmd, "Dimension Chamfer Angle") == 0) 
        ||   (strcmp(sCmd, "Dimension Diameter Perpendicular") == 0) || (strcmp(sCmd, "Dimension Radius (Extended Leader)") == 0) 
        ||   (strcmp(sCmd, "Place Center Mark") == 0) || (strcmp(sCmd, "Dimension Radius") == 0) 
        ||   (strcmp(sCmd, "Dimension Arc Distance") == 0))  
    {   
        goFlag = 1; // the active command is a dim command so dont deselect on reset
    }  
    else  
    {   
       goFlag = 0; // ok to reset - conflict mitigated  
    }    

    // user clicked reset and conflict minimized so go for it
    if (queueElementP->hdr.cmdtype == RESET)  
    {   
        if (goFlag == 0)    
            mdlInput_sendKeyin ("powerselector deselect", 0, 0, NULL);
    }
    return INPUT_ACCEPT;
}

// command entry
int main () 
{     
    RscFileHandle   rfHandle;  
    goFlag = 0;

    mdlResource_openFile (&rfHandle, NULL, FALSE);

    if (mdlParse_loadCommandTable (NULL) == NULL)  
        mdlOutput_rscPrintf (MSG_ERROR, NULL, 0, 4);

    mdlInput_setMonitorFunction (MONITOR_ALL, monitorQueue);
    return  SUCCESS; 
}

The conflict was created by sending a command, i.e. powerselector deselect, when commands that you didn’t want to terminate using reset were active – like dimension commands. The easiest way to work around this was to set a flag. If one of the dimension commands is active then don’t deselect on reset. The code and compiled ps_reset.ma is on cadmanage.com/cadgurus. Put the ma in your mdlapps folder so it will load when MicroStation is loaded. You can also use the keyin mdl load ps_reset to load this app.

About Mark Stefanchuk: Mark is a VP and senior consultant with CAD Management Resources, Inc. He divides his time between developing innovative custom software solutions and helping clients navigate complex design automation environments. If you would like to find out how he can assist you with your design technology he can be reached by contacting us at info@cadmanage.com.

One response to “Managing Usability”

  1. Kim says :

    Hi Cadgurus,
    Now that I use AutoCAD a lot more, this “not dropping the selection set” in Microstation bugged me too.
    I solved the problem more simply, but it probably isn’t as sophisticated as your solution. I am sending it to you, though, since it might be easier for the average user to implement.

    I simply made an F1 function key with “choose none”. F1 is near the escape key, so it sort of feels like AutoCAD when you want to quickly drop a selection set. People who switch back and forth between AutoCAD and Microstation might like the F1 key idea.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: