hi all,
New to programming c# for openroads.
I downloaded the ManagedSDKexample and started playing with the codes to try and alter the horizontal alignment reporter for a single element, but are having trouble understanding why it won't allow me to select any referenced element?
i managed to change the coding to display all alignments (including the ones from referenced in files) by cycling through them, but i just can't get it to select an element from a reference file and report on it.
regards
Hi Dennis,
in addition to advice from Mark Shamoun:
There are - depending on context and used approach - more places, where elements from references can be "blocked". I am not sure how the example you mentioned is written, but some tools are implemented on top of MicroStation standard "element selection" class DgnElementSetTool. This class allow to override isModifyOriginal method. When it returns true, references are blocked automatically, because elements in references cannot be modified.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: Dennis Chung
hi Jan,
yes, you were right.
all i needed was the below code.
thanks
protected override bool IsModifyOriginal() { return false; }
Hi,
Dennis Chung said:all i needed was the below code.
be aware there is difference between MicroStation concept (API) and OpenRoads one: For MicroStation, an element in reference is just another element with only few differences (like it is read-only). But ORD datamodel is more "virtual" and not all elements are part of such model (e.g. because they are plain graphics, not civil features).
So what can happen is that element is selected, but when you ask ORD API to "give me civil feature for this element", it's not possible. But it really depends with what feature particular tool work with and in what context.
P.S. Please use Insert > Insert code tool when you want to share a snippet (even only one line long).