Hello. Is there a way to determine if level table of model reference contains changes, so I should use mdlLevelTable_rewrite?
Thanks in advance.
Ok, thank you for the additional information. SYSTEM_LEVEL_CHANGE is the most appropriate course of action.
My API provides wrapper around model reference and user can add also levels using it. I did not have any internal variable to determine if user added any levels (hoped that model reference does hold it already), so I will add one into class and in destructor, when this variable will be changed, I will rewrite level table.
What type of (model reference) changes are you looking to determine and are you looking for notification, or to perform a manual (programmatic) comparison? e.g. Call mdlLevelTable_getDisplayMask(modelRef) once prior to an operation, then again at a later point to see if anything has changed.
If you could provide a little more insight about the problem you are attempting to solve I may be able to identify a different approach. Unfortunately, the level bitmask isDirty is a private method and the best we can do is notify an application once a change is about to propagate through.
Thanks Robert. It is not what I hoped for, but at least this way I can use to do some sort of lookup table to determine if model reference has changed.
You can create an event interest using mdlSystem_setFunction(SYSTEM_LEVEL_CHANGE, levelChanged) with the user function prototype being:
void levelChanged(DgnModelRefP modelRef,UInt32 levelId,int changeType);
Where changeType will be LEVEL_TABLE_CHANGE when a level table has pending changes, and modelRef will indicate what model reference the level table has changed in.
Answer Verified By: DanPaul