I haven't played with this myself yet, but what happens if you put dllfunc(DLLFunc_Spawn, apc) at the end rather than before setting size, origin, and other properties?
Also, try looking for a plugin that does something similar. That's probably the fastest way to figure out how to do it properly. I don't have any plugins in mind right now, sorry.