How do I get a list of all blueprint classes(in blueprint or in c++)?

at run time i want to use spawnActor node from blueprint.
now the problem is i have to supply class type as input.
for now i am using a predefined class reference array.
working fine.
but i have hundreds of classes .which i want to use randomly.
so i need to get the class list automatically.
that’s why my question:
“How do I get a list of all blueprint classes, that are a child of a specific blueprint at runtime?”

for now i am trying to figure out how “get All Actors Of class” node generates the dropdown class list.may be from that i can get some clue.