hello a few weeks ago i was trying to do some things similar to what you are trying to achieve here. with the help of some nice forumers i ended up making both a c++ function and a blueprint function to do exactly this . if you want i can share the code and you can take what you need.
the c++ version is a bit more powerful as it can actually be used in editor as well as runtime to spawn objects before you even press play. im still working on a way to get my blueprint node to be safe to use during construction script without causing an endless loop and crashing .
if this is what you meant then let me know and ill upload the c++ code
thanks
BIG THANKYOU to forumer smartyMARTY who helped me get this far :-p