# SetObjectOrder

Objects
Position
4.9.1.0 GWE4.9.5.0 CE
bool
object object_before_or_after Object before or after which sort_object is to be inserted.
object sort_object Object which is to be inserted before or after pObjBefore. Can be 0 in local calls.
bool after If not 0, sort_object will be inserted after object object_before_or_after (and not before).
Ensures that an object is internally sorted before or after another specified object. In this way, you can e.g. ensure that an elevator case is always drawn and processed before its elevator structure.
You should only resort objects of the same category, otherwise the internal handling mights get confused.
The actual resorting is done later but within the same frame as the script call.
SetObjectOrder(FindObject(TRE1), FindObject(TRE2));
Places the first found tree of type TRE2 before the first found tree of type TRE1.
ResortObjects
Resort
Sven2
2002-04