[ORD 2020 R3/Connect] Send to back tool (VBA)?

One of the biggest little complaints I get from folks in my office is that MicroStation does not have a "Send to Back" tool. I point out that we have a "Bring to Front" and Element Priority, but these concepts are not quite the same.

If I were to attempt writing a "Send to Back" routine, does anyone have any suggestions? I'd prefer VBA because I haven't gotten very far learning MDL/C, and I can write VBA without needing to compile anything. I should probably learn C++, but that's going to take some time, too.

A apologize for the vagueness. I'm looking for directions and ideas before I jump into coding. I'd prefer to pick the sharp minds around here than come to you in three weeks with some code that's just all the way wrong.
Thank you

Parents
  • Hi Mary,

    unfortunately "send to back" is a feature that cannot be implemented in any efficient way. And, in relation to display styles, in some scenarios these concepts (send to front) cannot be used at all.

    The original "send to front" was based on a fact, that when elements are displayed and no other post-processing is used (anti-aliasing, shading, priorities), elements are displayed in an order how they are stored in a design file. This approach is wrong for several reasons: It depends on technical aspect how element persistence is implemented (so e.g. in DB-like storage as i-model it does not make sense at all), it expects a behavior that is not defined, and any modification requires to change an order of elements, which is always inefficient.

    What "send to front" does is that it rewrites element in such way that MicroStation has to move it to the end of the file. It's valid operation, MicroStation does it when necessary, but it's implementation detail, "by accident" visible as the fact that last element in the file is displayed as the last (which is not defined anywhere and is not automatic fact).

    So, vice versa, "send to back" has to rewrite all elements in the design file, so the selected one will be the first one. As you can imagine, it's incredibly inefficient, because in fact the whole design file has to be rearranged just to modify one element.

    Of course, when any from operation mentioned above (display style, priorities...) is used, it will not work, because display style can be configured to ignore elements order, and some operations (like antialiasing) ignore it always.

    In longer perspective it you can be sure it will stop work, any storage optimization can break this rule (probably not, but it can happen), plus if (potentially) DGN will be changed to another "next generation" format, "elements order" will probably have not any meaning.

    With regards,

      Jan

    Answer Verified By: MaryB 

  • I actually kind of figured that - that there are too many other ways to override draw order, and that having to send any element to the beginning of the file would be a painful process. And the more I think about it, the less enamored I am of even trying.

    MaryB

    Power GeoPak 08.11.09.918
    Power InRoads 08.11.09.918
    OpenRoads Designer 2021 R2

        

  • Hi ,

    Similar to 's select and invert suggestion, one of our Bentley Professional Services colleagues created a MicroStation VBA utility called PokeIt and is available for downloading, a YouTube demo, and reviewing the VBA code behind.  PokeIt a number of productivity features and is listed under our programming Code Examples and Utilities page.

    HTH,
    Bob



Reply Children
No Data