Thanks for the reply, had to look up FSoftClassPath
const FSoftClassPath BlockPath(TEXT("/Game/Cas/BuildingBlock.BuildingBlock_C"));
const UClass* BlockClass = BlockPath.TryLoadClass();
checkf(BlockClass != nullptr, TEXT("expected non-null class"));
GetWorld()->SpawnActor(BlockClass, &SpawnPos);
this example can be found in the forums:
but as the next poster in that thread pointed out TryLoadClass() needs some parameter.
Sadly my Visual Studio Code does not display proper context help, have to download the UE sourcecode to figure this out.