Same Element Color, Different Color Displayed

I'm developing a MVBA which will facilitate adding a time-dimension (4D) to elements.  I am using tags to add this data, which is working great when it comes to displaying only certain "time-specific" elements (independant of their level).  For this I'm using the "UsesDisplaySet" properties - love it.  But I've got bigger fish to fry.  I'd like to be able to display certain elements (on a given level) as one color to the user, and other elements (on that same level!) as other colors to the user.

 I know MicroStation can do something like this, i.e. when you highlight or have a selection set, but does anyone know how I might be able to display - say 5 different elements (all on the same level and element color) in 5 different colors on the screen?

 Thanks for any help you can give (good or bad news)!

Chris Johnson (cjohnso3@ch2m.com)

  • Not sure how to code it myself, but our guys have used level overrides to do this sort of thing in the past to show progress. Worth looking into at least.



  • Chris:

    I'd like to be able to display certain elements (on a given level) as one color to the user, and other elements (on that same level) as other colors to the user.

    Named Groups

    Whatever method you go for, it clearly has to be independent of an element's level. Named Groups may provide that orthogonality.

    You can programmatically add elements to a Named Group. Here's the description of a named group member from VBA help …

    A NamedGroupMember object contains the information that controls how an Element behaves in a specific named group. This object type is necessary because an Element can be in more that one named group, and the behavior can be different in each of the groups.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Thank you so much for your time and attention, Mr. Sommers!

     I looked into it and, like you suggested, Named Groups would give me similar orthogonality [nice word] to using tags (my current approach).  One of the missing peices to the functionality I'm after is regarding displaying elements per their group/tag, independant of their level.  Ideally, this would mean not changing any of the element's properties (i.e. element color) - but just their "temporary" appearance (as if you could push the "per tag" button and put on your "
    per tag" glasses to see the elements according to their tags, but then take off those glasses, not having effected those elements, and see them as MicroStation natively displays them).

     If you do have any suggestions of how I could hijak how MicroStation displays an elements color so I could tell it how and when to alter its M.O., I'd really appreciate it.  FYI, my current "closest shot" is by changing the elements color per tag and doing a redraw WITHOUT doing a rewrite.  The downside of this is that it's too temporary and reverts as soon as a redraw occurs.

    If anyone knows how I could access a views "onRedraw" event through VBA I could certainly use that!

    Much appreciated,

    Chris Johnson (cjohnso3@ch2m.com)

  • I would think "copying" the elements to a transient element with the color necessary would suffice as this would display "on top of" the originial. When you want to revert to the original color, just delete the transient.

    HTH - Roy

  • Temporary Resymbolisation

    Chris:

    One of the missing pieces to the functionality I'm after is regarding displaying elements per their group/tag, independent of their level. This would mean not changing any of the element's properties (i.e. element color) but just their "temporary" appearance  …

    MicroStation XM and later use DirectX graphics for element display. One consequence of this is that the display is 'self healing'. If you make a temporary change to an element (e.g. change its colour without rewriting), the change persists only until the next view refresh. In other works, you can change an elements colour but you won't see the change unless you have exceptionally acute eyesight. And frankly, if your eyesight is good enough to spot a change of duration 1/25th second then you've no business programming VBA — you should be out there with the other super-heroes saving the world.

    You can either bite the bullet and make resymbolisation permanent (by rewriting modified elements), or you can use transient elements. Unfortunately, transient elements are not exposed in VBA for MicroStation XM. They are exposed in VBA for MicroStation V8i.

    You might also consider combining a rewrite of modified elements with MicroStation's undo/redo logic. Issue a mark command before starting your resymbolisation, then user can simply undo when she wants to revert to the previous state. There are some problems with this approach (e.g. you can't undo after exiting and restarting MicroStation, so a change that's supposed to be temporary ends up being permanent). Transient elements would be a better solution.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Jon Summers:

    Unfortunately, transient elements are not exposed in VBA for MicroStation XM. They are exposed in VBA for MicroStation V8i.

    In documentation is 08.09.02, so it should work in XM after this version. If no, we can use MDL wrappers...

     HTH

  • DanPaul:

    In documentation is 08.09.02, so it should work in XM after this version...

    Oops! I must have been looking at the previous version documentation.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions