Need to get the position of a mesh placed im my game c++

Basically i am putting some brushes around my scene and trying to spawn basic meshes on and around them. I know how to get the bounds of the meshes i place, but i don’t know to get the position of the other meshes that are statically placed in the scene.

for (TActorIterator It(World); It; ++It)
{
AStaticMeshActor* SMA = *It;
FVector Loc = SMA->GetActorLocation();
}

Thanks for the answer, it will probably solve my problem but i’ve found online that to use TActorIterator i need to
#include “Runtime/Engine/Public/EngineUtils.h”
but when i do that all the project (which is the basic c++ one) starts giving me error that i don’t have if i don’t include that file (like PrimaryActorTick is not defined). I know that i’m a bit generic and i’m sorry, but can you help me?