I'm attempting to navigate the EC properties of a line or line-string element. From a user perspective, an element has a segments property, leading to a list of segments...
I have extracted the Segments property of the line-string element to an ECValue using the MicroStationAPI. Its ToString() method tells me Prop 'Segments' value 'Count: 2 IsFixedSize: 0'. That's reasonable: I can see that this line-string has two segments. It also tells me Prop 'Segments' IsArray, which is expected. But it then tells me this: Prop 'Segments' value 'IECInstance containing struct value', when I'm expecting an array of segment.
ECValue
ToString()
Prop 'Segments' value 'Count: 2 IsFixedSize: 0'
Prop 'Segments' IsArray
Prop 'Segments' value 'IECInstance containing struct value'
How do I get the array of segments from the ECInstance obtained from the DGN element? ECInstance has a number of methods to add or remove array elements, but how do I read array elements?
ECInstance
Jon Summers said:How do I get the array of segments from the ECInstance obtained from the DGN element?
I think this blog should help you.
Jon Summers said:But it then tells me this: Prop 'Segments' value 'IECInstance containing struct value', when I'm expecting an array of segment.
It is because the property type is struct, not primitive value. In parallel, the property knows it is array. These two "features" exist in parallel, not together, as would be expected from OOP perspective (where array/list of types is normal).
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: Jon Summers
Jan Šlegr said:I think this blog should help you
Thanks for the pointer to that blog. It helped answer my question.
Regards, Jon Summers LA Solutions