Need Help to recursively import RDCs from a Folder and store each element into a Collection
OK, so this code works with the test data on my rig:
import bpy
import os
import sys
import glob

directory_im = 'C:\\LowPoly2\\'
files = glob.glob(directory_im + &quot;*.rdc&quot;)

# helper method to create a new LayerCollection
# also setting it to the active LayerCollection
# the Google Maps importer then puts the objects into that LayerCollection automatically
def create_coll(parent_layer_collection, collection_name):
    new_col = bpy.data.collections.new(collection_name)
    parent_layer_collection.collection.children.link(new_col)
    new_child_layer_coll = parent_layer_collection.children.get(new_col.name)
    
    bpy.context.view_layer.active_layer_collection = new_child_layer_coll
    
    return new_child_layer_coll
    

# create a master collection to batch import the files to, or re-use the currently active collection in the scene - up to you
master_collection =  bpy.context.view_layer.active_layer_collection

# iterate over files
for f in files:
    head, tail = os.path.split(f)
    collection_name = tail.replace('.rdc', '')
    
    # create a new LayerCollection to import the objects to
    # I am storing the reference to it here in case you need to run further actions on it
    # e.g. changing color etc etc
    myCol = create_coll(master_collection, collection_name)

    # run the importer, it will work within the new sub-collection
    bpy.ops.import_rdc.google_maps(filepath=(f), filter_glob=&quot;.rdc&quot;, max_blocks=-1)

It becomes rather tricky because you need to deal with both Collections and LayerCollections, to be able to set an active layer collection. The first function creates just that, and returns a LayerCollection to be used, which is also set as active collection on the way. By doing that, the importer automatically places its objects in there &quot;for free&quot;.