How to attach a socket to actor using Python API?

Hallo
I am trying to attach a socket(whch is a blueprint) to the actor. But the error is throwing.

Here I am accessing the parent actor from the leevel

level_actors = unreal.EditorLevelLibrary.get_all_level_actors()
filtered_list = unreal.EditorFilterLibrary.by_actor_tag(level_actors, Car_tag, filter_type=unreal.EditorScriptingFilterType.INCLUDE)
actor = filtered_list[0]

Here setting the location for teh socket from a list.


cam_location = unreal.Vector(item['location']['x'], item['location']['y'], item['location']['z'])
cam_rotation = unreal.Rotator(item['rotation']['roll'], item['rotation']['pitch'], item['rotation']['yaw'])

Then loading socket using

ac = unreal.EditorAssetLibrary.load_blueprint_class('/Game/Resim/Blueprints/BP_Camera.BP_Camera')

Then after that i try to attach using:

unreal.Actor.attach_to_actor(actor, ac, cam_location, cam_rotation )

and finally got the error like:

LogPython: Error: unreal.Actor.attach_to_actor(actor, ac, cam_location, cam_rotation )
LogPython: Error: TypeError: attach_to_actor() required argument ‘rotation_rule’ (pos 4) not found