sim.partProperty(sim.pmap(x,y), "ctype", value)
?-- you can replace sim.FIELD_CTYPE with "ctype"
-- and elem.DEFAULT_PT_DUST with an integer between 0 and 255, because that's the range element IDs come in
sim.partProperty(sim.partID(x, y), sim.FIELD_CTYPE, 2^stack_pos)