Q How do I modify the order in which …
A This question is often posted on the Bentley Discussion Groups. There are two parts to the answer, because the element display order in a model is overridden by the reference display order. MicroStation XM introduced 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 MicroStation V8 2004 Edition 2D 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.
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.
Because of this natural drawing order, your perception of the drawing may not be what you expect. You may 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.
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.
wset add (Working Set Add) wset drop (Working Set Drop) Those commands are literally obscure: they are not mentioned in the MicroStation V8 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.
"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 XM.
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.
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.
MicroStation XM™ 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).
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.
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.