Functions

Functions

void mdlCapability_setDefault ()
 This file contains the public functions that deal with "Workmode"s. More...
 
bool mdlCapability_isEnabled (UInt32 lCapability)
 Check status of a specific capability in current workmode. More...
 
StatusInt mdlCapability_set (UInt32 lCapability, bool bOnOff)
 Change the status of a specific capability in current workmode. More...
 
StatusInt mdlCapability_setMask (BitMaskP pCapMask)
 Reset/override the capability mask in current workmode. More...
 
StatusInt mdlCapability_getMask (BitMaskH ppCapMask)
 Obtain a copy of capability mask. More...
 
void mdlCapability_freeMask (BitMaskH ppCapMask)
 Dispose capability mask obtained from mdlCapability_getMask. More...
 
void mdlCapability_outputDisabledMessage (WCharCP pCapabilityName)
 Output a specific or generic message in the Message Center that this feature is disabled in current workmode. More...
 

Detailed Description

Function Documentation

void mdlCapability_freeMask ( BitMaskH  ppCapMask)

Dispose capability mask obtained from mdlCapability_getMask.

Parameters
[in]ppCapMaskcapability mask to be freed
Returns
void
See also
mdlCapability_getMask
Remarks
Required Library: mdlbltin.lib

Workmode_Capability

StatusInt mdlCapability_getMask ( BitMaskH  ppCapMask)

Obtain a copy of capability mask.

Memory is allocated to hold the mask, therefore it must be freed after the use of it by calling free function mdlCapability_freeMask.

Parameters
[out]ppCapMaskcopy of capability mask queried
Returns
SUCCESS - allocated memory and copied mask successfully; otherwise failed
See also
mdlCapability_freeMask
Remarks
Required Library: mdlbltin.lib

Workmode_Capability

bool mdlCapability_isEnabled ( UInt32  lCapability)

Check status of a specific capability in current workmode.

Parameters
[in]lCapabilityspecific capability to check
Returns
true - given capability is enabled; false - capability is disabled
Remarks
Required Library: mdlbltin.lib

Workmode_Capability

void mdlCapability_outputDisabledMessage ( WCharCP  pCapabilityName)

Output a specific or generic message in the Message Center that this feature is disabled in current workmode.

Parameters
[in]pCapabilityNamespecific capability name or null
Returns
none
See also
mdlDialog_capabilityDisabledInfoBox
Remarks
Required Library: mdlbltin.lib

Workmode_Capability

StatusInt mdlCapability_set ( UInt32  lCapability,
bool  bOnOff 
)

Change the status of a specific capability in current workmode.

Parameters
[in]lCapabilityspecific capability to be changed
[in]bOnOffstatus of the the capability
Returns
SUCCESS - capability mask updated successfully; otherwise failed
Remarks
Required Library: mdlbltin.lib

Workmode_Capability

void mdlCapability_setDefault ( )

This file contains the public functions that deal with "Workmode"s.

Work Mode Summary

Work Mode is an environment in which certain actions are restricted in such a way that elements created at the end will be compatible with the target file format. Currently supported work modes are DGN, DWG and V7. Each of these formats corresponds to a work mode which gets automatically activated upon a file is opened. When in V8 DGN file, the user can change the work mode by setting the environment variable MS_WORKMODE to a desired value. In addition, capabilities controlled by work modes can also be changed by setting configuration variables defined in file workmode.cfg. Change of work mode is usually done at project level by a system administrator.

For application developers however, work mode can be manipulated by a set of MDL API's. The work mode is stored as bit mask. Each bit represents on/off status of a certain capability. Use mdlCapability_isEnabled to query status of a capability in current work mode, and use mdlCapability_set to change a capability status. Capability index is defined in file msdefs.h.

When a capability is disabled, it is often desired to inform the user about it. Use mdlDialog_capabilityDisabledInfoBox to bring up a general capability disabled dialog box (a strong reminder), or mdlCapability_outputDisabledMessage to output the same message in the Message Center (a weak warning).

Usage example: by default self-referencing is disabled in DWG work mode as AutoCAD does not have such capability. However, if the receiving program can handle self-referencing, this capability can be turned on in DWG work mode:

Workmode_System ( mdlSystem_getWorkmode, mdlSystem_setWorkmode ) Workmode_DialogBox ( mdlDialog_workmodeInfoBox, mdlDialog_capabilityDisabledInfoBox ) Workmode_Capability ( mdlCapability_setDefault, mdlCapability_isEnabled, mdlCapability_set, mdlCapability_setMask, mdlCapability_getMask, mdlCapability_freeMask, mdlCapability_outputDisabledMessage ) Set the capability mask to default value based on current workmode (i.e. all bits=1 for DGN workmode and all bits=0 for all other workmodes).

Returns
void
Remarks
Required Library: mdlbltin.lib

Workmode_Capability

StatusInt mdlCapability_setMask ( BitMaskP  pCapMask)

Reset/override the capability mask in current workmode.

Parameters
[in]pCapMasknew mask of capability
Returns
SUCCESS - capability mask reset successfully; otherwise failed
See also
mdlCapability_getMask
Remarks
Required Library: mdlbltin.lib

Workmode_Capability


Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.