There is CountItems:
SCAR Code:
{*******************************************************************************
function CountItems(Identifier: Integer; ItemType: string; tol: TIntegerArray): Integer;
By: WT-Fakawi / Sumilion
Description: Counts Items in the inventory.
ItemType - 'dtm', 'bitmap', 'bitmap mask', 'color'
Item - name/value of your dtm/bmp/color/bmpmask.
Tol - 'dtm' - [] (dtm's can't have tolerance).
'bmp' - [BMPTol].
'color' - [COLOUR Tol, Colour Count].
'bmpmask' - [BMPTol, ContourTol].
*******************************************************************************}