Yes, you can get a reference to trees painted with the painting tool. You can find the InstancedFoliageActor, the actor that the editor stores all foliage instances in, using a TActorIterator<AInstancedFoliageActor>. Find the instanced static mesh components within that actor.
Another note: as of 4.8 if you want to use foliage C++ classes (edit: like InstancedFoliageActor) you will have to include the Foliage module. To do this, find your Source/MyProject/MyProject.Build.cs file and add “Foliage” to the PublicDependencyModuleNames list.