Here are answers to questions about MicroStaton Snap Modes that are posted from time to time on the Bentley Discussion Groups. The questions are posted by MDL developers working with MicroStation®.

Q How do I get the current MicroStation Snap Mode? I don't see a way to do this.

A You can't see a way to do this because Bentley forget to mention it in the MDL documentation. You can get and set the Snap Mode using the mdlParams_getActive and mdlParams_setActive functions.

What's missing from MDL help is the ACTIVEPARAM_SNAPMODE constant, which is not mentioned in the documentation for those functions. The available Snap Modes are listed in an enumeration …

#include <mdl.h>     //  provides ACTIVEPARAM_SNAPMODE
#include <msdefs.h>  //  provides enum SnapModeVals

//  Get the current SnapMode
SnapModeVals snapMode = SNAP_MODE_FIRST;
mdlParams_getActive ((void*)&snapMode, ACTIVEPARAM_SNAPMODE);

//  Set the current SnapMode
SnapModeVals snapMode = SNAP_MODE_NEAREST;
//  See MDL help about this function to see why you need to cast to void*
mdlParams_setActive ((void*)snapMode, ACTIVEPARAM_SNAPMODE);