The culprit! Start with an empty and unused layer and see how far you get. Should be getClass(integer index). Would it make sense to have a getClassByName() for symmetry with the Layer objects? > thisclass = mapscript.classObj(thislay)