[CONNECT U12] Monitor EC data change best practice?

Hi,

this my question is more about best practice, not specifically targeted to C++ or C#. C# is preferred in my current project, but when the solution will be available in C++ only, no problem.

Situation: There is an element with custom EC data attached. The data are available in Properties (Element Information) dialog and can be modified by a user. Such change is saved to persistent storage (DGN V8 file) by MicroStation automatically.

Question: Is it possible and what is recommended approch to monitor such change to be able to react on the change (e.g. to modify the element size/shape/etc.)?

I have not done any testing or research yet, but I can imagine that XAttribute changed event is fired when EC data are changed, but it seems to me a bit complicated (go through the whole path from XAttribute, test whether it's EC data or not and to what element it belongs). Maybe there is some other solution available, e.g. to monitor EC data particularly or to hook system responsible for rendering EC data in GUI?

With regards,

  Jan

Parents
  • Hi Jan,

    We have internal native way to monitor changes to XAttributes that store ECInstances.  Those APIs are not exposed yet. It may significantly impact performance of Microstation especially while processing bulk elements containing ECInstances. 

    Still, can you please file an idea. I will connect with you for more inputs on that idea.

    Btw, you can explore Bentley.ECObjects.UI.ECPropertyPane.OnPropertyValueChanging. This delegate fires up when you try to change any property from property pane. It gives you beforevalue and after value. You can reject afterValue by returning false. 


    This is a test

Reply
  • Hi Jan,

    We have internal native way to monitor changes to XAttributes that store ECInstances.  Those APIs are not exposed yet. It may significantly impact performance of Microstation especially while processing bulk elements containing ECInstances. 

    Still, can you please file an idea. I will connect with you for more inputs on that idea.

    Btw, you can explore Bentley.ECObjects.UI.ECPropertyPane.OnPropertyValueChanging. This delegate fires up when you try to change any property from property pane. It gives you beforevalue and after value. You can reject afterValue by returning false. 


    This is a test

Children