VCGetDrawOrdinal


Version:

5.0

Description:

Returns the draw order position of the specified entity

Declaration:

 

C/C++

extern "C" APICALL int WINAPI VCGetDrawOrdinal(short* iError, ENTITYHANDLE eH, vbool ValidOnly);

Delphi

function VCGetDrawOrdinal(var iError: Smallint; eH: LongInt; ValidOnly: WordBool):LongInt; stdcall;

ActiveX/COM

Function GetDrawOrdinal(ByVal eH As Long, ByVal ValidOnly As Integer) As int

Parameters:

eH - the entity to retrieve the draw position for

ValidOnly - Flag to indicate whether all entities or only valid (non-erased) should be retrieved

Return Value:

The zero based draw position of the entity, -1 on error

iError Code:

0 - Success
1 - Invalid World
2 - Entity handle out of range

Notes:

VCADD's draw order is maintained as a linked list of entity handles.  The draw order list is parsed from beginning to end and the entities are drawn in the order that their handles are encountered in the list.  The first entity in the list is drawn first and the last entity is drawn last.  The draw order can be manipulated by changing an entity's position in the draw order list.

This call retrieves the relative draw position of an entity.  The first entity to draw will return an ordinal of 0, the second an ordinal of 1, and so on.

This function obtains the ordinal by scanning the draw list for the desired handle. Because of this, it can be a time consuming call.  If you want to retrieve the ordinals for a large number of entities, it is more efficient to use VCGetDrawList to obtain a local copy of the draw list and scan it directly.

See Also:

VCDrawCurrentEntityFirst, VCDrawCurrentEntityLast, VCDrawCurrentEntityBefore, VCDrawCurrentEntityAfter, VCDrawSelectedLast, VCDrawSelectedBefore, VCDrawSelectedAfter