[CONNECT C#] How to determine which properties changed when implementing IDgnECNetChangeListener

I have installed:

MicroStation CONNECT Edition
10.15.0.74

MicroStation CONNECT Edition SDK
10.15.00.076

I have implemented IDgnECNetChangeListener to listen to change events.  I would like to capture a modification event for a given ECProperty on instances of a given ECClass.

The method DgnECInstancesChanged is provided a list of DgnInstanceChangeRecord.  From this record, is there a way to determine which of the ECProperties were the ones that changed?

Thanks,

John M.

  • Hi John,

    I think the information about changed properties is not tracked. I guess it's because ECInstance is written as the whole, so such event can represent one property change as well as complete update of the whole structure.

    As wrote in his blog, "before change" event (or state) is not available because of performance reasons.

    Can you provide more details and context, what do you want to achieve? In general, the events messaging, where the final state is provided only, leads to system based on state (data available now) and not based on change events (value A is changed to value B).

    When you will go through EC(Objects) API, you will see different "property change" events exist, useful in specific situations (ECPropertyValueChanged or ECPropertyPane.AfterPropertyValueEdit), but I think no from them allows listen for general changes over all ECInstances.

    With regards,

      Jan

  • Hey Jan,

    See image, below.  The rectangular cell on the left has an ItemType applied to it.  The oval cell on the right represents a label associated to the first cell.  At placement time the text contents of this second cell was set to the value of one of the ItemType properties of the first cell.  If later on this property value is changed I need to automatically update the value of the the text of the second cell.

    I have implemented my own Edit command so I can readily implement this text update in that code.  However I would also like it to update if the user modifies the ItemType property from the Items Browser.   And of course that would have to occur after the property value has changed, not before.

    -John M.

  • If later on this property value is changed I need to automatically update the value of the the text of the second cell.

    Isn't done automatically, when text with fields is created (or Label cell is placed)?

    Regards,

      Jan

  • I would also like it to update if the user modifies the ItemType property
    Isn't that done automatically, when text with fields is created (or Label cell is placed)?

    I agree with Jan: experience tells me that a text field that displays an Item instance property updates automatically.  It makes no difference how you edit the property, once it has been changed then the display update is automatic.

    All our TagWorks apps behave the same way.  They create multi-line labels that are populated with Item instance data.

    That also applies to calculated property values: one property may rely on another property and some other value such as element area.  An Expression calculates the result and applies it to the property.  MasterPlanner makes use of an Expression to calculate its building count property...

    C++ vs .NET

    I should add that, when we started development of the TagWorks apps, we hoped that CONNECT would give us the choice of using C++ or .NET.  The decision about which language to use made itself, because the C++ MicroStationAPI provides TextField::CreateForElement(), which remains unavailable in .NET several years after CONNECT was released.  VBA is hopeless in that area also.

    You can do a lot with Item Types in .NET, but you can't create smart labels without some TextField methods.  Same goes for Reports: there's a C++ API but not a .NET API.

     
    Regards, Jon Summers
    LA Solutions

  • I agree with Jan. Because of performance reasons, I couldn't implement "Before Change". Please file a service ticket. 


    This is a test