MS CE, Update 15: ChangeTrackAction enum, Porting from V8i

In V8i we are using the following Change_Track_Action enums (amongst others):

  • CHANGE_TRACK_NewFPosModify: the element was changed and moved to a new file position
  • CHANGE_TRACK_Drop: a complex element was dropped to its components

Looking for the corresponding Connect enums there are no equivalents available. So question is: How  to progress ???

Thanks for any suggestions,

Martin

  • CHANGE_TRACK_NewFPosModify

    Drop seems to miss, but I guess CHANGE_TRACK_NewFPosModify is ChangeTrackAction::AddComplete because fileposition starts to become obsolete in V8-DGN Format, ok starts, there are still a lot of function, that need filepos :-)

    Mit freundlichen Grüßen / Best regards
    Volker Hüfner

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • Looking for the corresponding Connect enums there are no equivalents available

    Look in DgnPlatform.h to find this...

    enum class ChangeTrackAction
    {
        Delete            = 1,  //!< An element was deleted from the file.
        Add               = 2,  //!< An element was added to the file.
        Modify            = 3,  //!< An existing element was changed and rewritten to the file in place.
        AddComplete       = 4,  //!< An element (and its xattributes) were added to the file.
        ModifyFence       = 5,  //!< The fence was modified.
        Mark              = 7,  //!< Used to delineate commands in undo buffer.
        ModelAdd          = 9,  //!< A model was added to the file.
        ModelDelete       = 10, //!< A model was deleted from the file.
        XAttributeAdd     = 11, //!< An XAttribute was addeed to an element.
        XAttributeDelete  = 12, //!< An XAttribute was deleted from an element.
        XAttributeModify  = 13, //!< some part of the XAttribute was modified.
        XAttributeReplace = 14, //!< An XAttribute was replaced.
        ModelPropModify   = 15, //!< A model's properties were modified.
        CustomEntry       = 16, //!< Application data held in the undo buffer (\em not an element-level change to the file).
        ModifyComplete    = 17, //!< An existing element (and its xattributes) were changed and rewritten to the file in place.
        Last              = ChangeTrackAction::ModifyComplete,
    };    
    
    //! ChangeTrackAction's are the type of direct changes that happen to DGN elements.
    //!   ChangeTrackAction::Add, ChangeTrackAction::Delete and ChangeTrackAction::Modify are self-explanatory.
    //!   ChangeTrackAction::Mark is used to delineate a logically related set of changes in the undo buffer.
    //!   ChangeTrackAction::ModelAdd means a model was added to the design file, and
    //!   ChangeTrackAction::ModelDelete means a model was deleted from the design file.
    

    Set your callback using ChangeTrack::AddChangedFunction (yourChangeTrackFunc)

    The signature of yourChangeTrackFunc is...

    void ChangeTrackFunc_Changed(  MSElementDescrP newDescr, 
                                   MSElementDescrP oldDescr, 
                                   DgnPlatform::ChangeTrackInfo *info, 
                                   bool *cantBeUndoneFlag)
    

    Argument info has member ChangeTrackAction.

    Usage...

    /// Define yourChangeTrackFunc
    void yourChangeTrackFunc (MSElementDescrP newDescr, 
                              MSElementDescrP oldDescr, 
                              DgnPlatform::ChangeTrackInfo *info, 
                              bool *cantBeUndoneFlag)
    {
      switch (info->action)
      {
        case ChangeTrackAction::Add:
          // Element added
          break;
        case ChangeTrackAction::Modify:
          // Element modified
          break;
        case ChangeTrackAction::Delete:
          // Element deleted
          break;
        ... more possibilities
      }
    }

     
    Regards, Jon Summers
    LA Solutions

  • These 2 event types are no longer relevant.

    CHANGE_TRACK_NewFPosModify: the element was changed and moved to a new file position

    Rewriting an element w/larger size (such as adding a linkage) no longer causes it to receive a new file position, will just be ChangeTrackAction::Modify.

    CHANGE_TRACK_Drop: a complex element was dropped to its components

    Drop complex no longer just deletes the header and marks the components as deleted, drop is just normal delete/add events, ChangeTrackAction::Delete and ChangeTrackAction::Add.

    HTH

    -B



  • Thank you, Jon for your all encompassing answer concerning the usage of ChangeTrackAction functions within MS CE. Unfortunately this does not answer the question what happend to the enum members CHANGE_TRACK_NewFPosModify and CHANGE_TRACK_Drop.

  • Thank you Brian for your answer. This is exactly what I was looking for.

    Nevertheless: I think this piece of information is it worth to be written into the MS CE API Documentation. This is a general problem with the Bentley documentation, where some background information is not described in detail or missing at all.

  • It certainly should be mentioned in the porting help documentation (if it's not already).