Q How do I modify the element display order of these versions of MicroStation?

Q How do I display text on top of a filled background?


Element Display Order

A This question is asked from time to time on the Bentley Community Forums. There are two parts to the answer, because the element display order in a model is overridden by the reference display order. MicroStation CONNECT, MicroStation V8i and MicroStation XM have element ordering by level. Levels may be assigned a priority, which elements on that level inherit. The level priority is the element display priority.

A 2D MicroStation V8 2004 Edition model has no instrinsic ordering. The same is true of models and files created with earlier versions of MicroStation. The display order depends on an element's file position, as described in the introduction. The situation with the earlier MicroStation/J and the current MicroStation V8 is the same. You've probably figured out that Z Ordering implies that MicroStation would re-order its internal list of elements depending on each element's Z Order value.

To understand the background to the problem with MicroStation V8 2004 Edition (and earlier versions of MicroStation), I've included an introduction.

There's also an article about display order on the Ask Inga website.

Introduction

MicroStation stores graphic elements in a DGN file. The file is sequential, meaning that the first element is stored at position one and the last element is stored at the end of the file. When MicroStation reads a DGN file into memory, the sequence ordering is preserved as the elements are stored in a list. When MicroStation draws elements on your computer screen, it starts at the first element in the list and continues until it reaches the final element.

From MicroStation XM™ and later you can assign a drawing priority to each level or element. An element's drawing priority determines what elements appear over or under other elements.

MicroStation CONNECT, MicroStation V8i, MicroStation XM and Z Ordering

MicroStation CONNECT, MicroStation V8i™ adds Z Ordering by level to 2D files. The solution includes concepts like 'this level is in front of that level' (in a 2D file). A graphic element inherits its display priority from the level on which you create it. You can assign a display priority explicitly to an element after you've drawn it.

In a 3D model, the spatial relationship of objects determines their appearance.

Z Ordering is used in many 2D illustration tools. If one graphic object has a Z Order greater than another, the former is always displayed over the latter. In computer graphics terms, the object with the higher Z Order is displayed last: where the two intersect, the first object's pixels are obliterated by those of the second object. This model is intuitive to graphic designers, who only have to think in two dimensions.

For an example of an application that uses MicroStation's transparency and priority, take a look at LA Solutions' FlexiChart™.

FlexiChart produced this Column Chart

Unfortunately, or fortunately, depending on your point of view, MicroStation is not a 2D illustration tool. It's a sophisticated product that happens to be able to perform 2D drawing operations in addition to its mastery of 3D. Its 3D viewing operations mean that you can render, or visualise, a 3D model. Depending on your viewpoint in the model (i.e. your camera position), objects will appear naturally in front of or behind other objects. The concept of Z Ordering is intrinsic to a 3D model.

Legacy Draw Order

If you want MicroStation XM to behave like MicroStation V8, you can set MicroStation configuration variable MS_LEGACYDRAWORDER (not available in MicroStation CONNECT or MicroStation V8i). If you want MicroStation CONNECT or MicroStation V8i to behave like MicroStation V8, there's an option on any display style that uses the wireframe display mode Use file order for display.

Sequential Elements & Sequential Display

With MicroStation V8's natural drawing order, your perception of the drawing may not be what you expect. Perhaps you want MicroStation to draw red lines over the top of green rectangles, but there's no obvious way to do that. However, there's a clue in the file format: elements at the end of the file are drawn over elements at the beginning of the file, so they appear on top. What you need is a way to force some elements (i.e. those that you want to appear on top of others) to the end of the file.

MicroStation reads elements from your DGN file into its internal display list. When you update a view, MicroStation first scans the dispay list to determine those elements that should be visible in the view. That is, elements outside the view are ignored. Next, starting with the first element, it draws each object in turn until it reaches the end of the list.

The result of drawing elements in sequence is that the last element to be drawn writes over any previous element. Our human perception is that an element drawn later is on top of an element drawn earlier. Suppose you have ten elements in a drawing, which you created in order 1…10. When you update a view, MicroStation draws element 1 first and element 10 last; element 10 appears on top of the previous 9 elements. How do you make element 1 appear on top of the others? The answer may be on the tip of your tongue: move element 1 to the end of the display list.

Moving an Element to Appear On Top

This raises the question, "How do I move an element to the end of the display list?" There's no command to do that. But, you can modify the file position of an element with a command added from version 8.1 and later: ORDER ELEMENT FRONT

Some obscure commands that date from the forerunner of MicroStation, the Intergraph Graphic Design System (IGDS), provide similar functionality.

Those commands are literally obscure: they are not mentioned in the MicroStation documentation, but have been mentioned more than once on the Bentley Discussion Groups.

To reorder an element, select it so it shows the selection grab handles, then keyin the ORDER ELEMENT FRONT command (or the WSET ADD, WSET DROP commands). MicroStation moves the selected element from its current file position to the end-of-file position. With the next view update, MicroStation rebuilds its display list and the modified element is drawn last and so appears on top of previous elements. The command also works with a selection set of several elements.

Mission Impossible: Moving an Element Behind Other Elements

"Now I know how to make an element appear on top of other elements," you mumble to yourself, "can I make elements disappear behind other elements?" In other words, does MicroStation have something like an ORDER ELEMENT BACK command? Unfortunately, the answer is no. Here's the response from Keith Bentley to that question posted to the Bentley Discussion Groups: The answer to why there's no 'send to back' command is more complicated, but take my word for it that it is and we just decided not to do it for now.

One reason such a command doesn't exist may be performance. Suppose we want to move element 9 to the back of our list of ten elements. Because there isn't an empty space at the beginning of the list, first MicroStation would have to move elements 1…8 to the end of the list to create an empty space, then move element 9 into the hole created. With a list of ten elements, that probably wouldn't hurt, but with a large file of thousands, or tens of thousands of elements, the move operation would hardly be instantaneous.

The real solution to this problem is Z Ordering. Bentley have provided this solution with MicroStation CONNECT, MicroStation XM and MicroStation V8i.

Reference Display Order

MicroStation reference files are DGN files. MicroStation gathers elements from each reference file and adds them to its display list. The References dialog provides a mechanism to modify the order in which reference files are scanned while gathering elements. From the Settings menu, choose Update Sequence: the Update Sequence dialog appears …

The First, Last, Up and Down buttons let you modify the display sequence of both reference files and the active model. That is, you can specify that the active model is drawn either before or after all reference files.

Note that the reference file update sequence is unrelated to the element file order in each file. For each reference file, the element data is sequential as described above.

Plotter Pen Tables

MicroStation provides sophisticated plotting capabilities. You can configure a Plotter Pen Table to perform display ordering. There is plenty of information about Pen Tables in MicroStation help.

Pen Tables are independent of MicroStation's display technology. If your only concern is to have graphic elements printed correctly on paper or to a PDF file, then you don't have to worry about display order. Instead, create a Pen Table that instructs MicroStation's plotting sub-system to order levels in the way you want.

Display Text over a Filled Background

A MicroStation V8 lets you use a library of user-definable Text Styles. Usually, Text Styles will be defined by a CAD Administrator in a Design Library (DGBLIB) available to all MicroStation users.

Text Styles provide a way of make text look consistent in your DGN models. For example, if all interior labels should be blue in Tahoma font, then you can define a Text Style named Interior-Tahoma and apply it to all those labels …

Text Style Interior-Tahoma

Text Styles solve a problem that plagued earlier users of MicroStation: how do you ensure that text is displayed above other elements? A frequent requirement is to display text in a box that floats over other elements. With MicroStation V8i it's easy:

Here's an example of a Text Style similar to the previous one, but having a cream coloured background …

Text Style Interior-Tahoma