[CONNECT C++] DgnElementSetTool enum ErrorNums

Class DgnElementSetTool defines enum ErrorNums...

enum ErrorNums
{
  ERROR_NUM_NoFence = 68, 
  ERROR_NUM_NoFenceElems = 122, 
  ERROR_NUM_NoFenceElemsOutside = 250, 
  ERROR_NUM_NoSSElems = 85, 
  ERROR_NUM_NotSuportedElmType = 609, 
};

Those values don't appear accidental.  However, I can't see anywhere where that enum is used.

  • The default implementation of several DgnElementSetTool methods calls OutputErrorMessage with these enum values to output errors, for example:

    bool            DgnElementSetTool::_OnInstall ()
        {
        if (SOURCE_Fence == _GetElemSource () && !FenceManager::GetManager().IsFenceActive ())
            {
            OutputErrorMessage (ERROR_NUM_NoFence);
            return false;
            }
    
        if (SOURCE_SelectionSet == _GetElemSource () && !SelectionSetManager::GetManager().IsActive ())
            {
            OutputErrorMessage (ERROR_NUM_NoSSElems);
            return false;
            }
    
        // Don't allow install if destination model is unspecified...
        return (INVALID_MODELREF != _GetDestinationModelRef ());
        }

    A sub-class of DgnElementSetTool might also want to call OutputErrorMessage to output the default error message from a method it overrides. There is no significance to the actual enum values *anymore*.

    HTH

    -B



    Answer Verified By: Jon Summers