hexagon logo

How to create a velocity measure with a python script

I have the following function. There is a part with several markers all containing 'f' in the marker name. I need to loop through the markers and create a velocity measure on each one~Vx in this case. I get an error saying that the object has no such measureable characteristic. I have tried to pass a few different arguments in the 'object' parameter to no avail. Any help in this matter would be greatly appreciated.
 
mod = Adams.getCurrentModel()
def velocityMeasures():
modelName = mod.full_name
part =Adams.stoo(f"{modelName}.myPart")
markerKeys=list(part.Markers.keys())
for key in markerKeys:
if 'f' in key:
obj = part.Markers["f{key}"]
mod.Measures.createObject(name=f"Vx{key}", object=obj, characteristic='translational_velocity', component='x_component')