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... | |
void mdlCapability_freeMask | ( | BitMaskH | ppCapMask | ) |
Dispose capability mask obtained from mdlCapability_getMask.
[in] | ppCapMask | capability mask to be freed |
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.
[out] | ppCapMask | copy of capability mask queried |
Workmode_Capability
bool mdlCapability_isEnabled | ( | UInt32 | lCapability | ) |
Check status of a specific capability in current workmode.
[in] | lCapability | specific capability to check |
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.
[in] | pCapabilityName | specific capability name or null |
Workmode_Capability
StatusInt mdlCapability_set | ( | UInt32 | lCapability, |
bool | bOnOff | ||
) |
Change the status of a specific capability in current workmode.
[in] | lCapability | specific capability to be changed |
[in] | bOnOff | status of the the capability |
Workmode_Capability
void mdlCapability_setDefault | ( | ) |
This file contains the public functions that deal with "Workmode"s.
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).
Workmode_Capability
StatusInt mdlCapability_setMask | ( | BitMaskP | pCapMask | ) |
Reset/override the capability mask in current workmode.
[in] | pCapMask | new mask of capability |
Workmode_Capability