% define if not in existence systemdict /currentcid known not { systemdict /currentcid 0 put % start with 0 } if % make a unique one /uniquecid { currentcid 1 add /currentcid 1 index % correct stack order store % assign new value to CurrentCID } def % make ID unique