A minor correction to the code in my previous post: The variable name lSimpleSpaceID is used inside the first for-loop. It should actually be lSpaceID, which is declared just above that loop. Alternatively, if you don't want to put the geom into a new space anyway, you can just replace it with aSpaceID. Greets, Mark