An ECInstance contains one or more properties. The value of a property can be obtained using ECInstance.GetValue() or ECInstance.GetValueUsingAccessor(). Both methods work OK.
ECInstance
ECInstance.GetValue()
ECInstance.GetValueUsingAccessor()
What is the purpose of an ECValueAccessor? There is an enigmatic description in MicroStationAPI help...
ECValueAccessor
A structure used for describing the complete location of an ECValue within an ECInstance.
They can be thought of as the equivalent to access strings, but generally do not require any string manipulation to create or use them. ECValueAccessors consist of a stack of locations, each of which consist of a triplet of an ECEnabler, property index, and array index. In cases where the array index is not applicable (primitive members or the roots of arrays), the INDEX_ROOT constant is used
As always, an example would be welcome. ECInstance.GetValue() seems to work OK for me. Where does 'string manipulation' come into this? Am I losing something by not using an ECValueAccessor?
Hi Jon,
Jon Summers said:There is an enigmatic description in MicroStationAPI help...
What is enigmatic in the text? I think it is pretty clear.
Jon Summers said:Where does 'string manipulation' come into this?
It happens every time an access to data structure is described using (access)string, e.g. in ECObjectsStatus GetValue(ECValueR v, WCharCP propertyAccessString) method.
Jon Summers said:Am I losing something by not using an ECValueAccessor?
I think it depends a lot on context and what you do with EC data, but probably not until access strings are used often in code (and when ECValueAccessor can offer more efficient access to data).
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point