how to change CSV file by using macro?

I would like to use the API and the macro to modify and animations.

I am using "motion type - data points - load CSV file" to drive the motor.

I would like to ask that I can do followings.

1.

Change the contents of the CSV file used

-> Rebuild motion study

-> The motion data of the animation is changed also in accordance with the modified CSV file.

2.

Access "motor type - edit" (by macro or API)

-> Change CSV data by using macro (or API)

(and I could not find code of it. It does not exist?)

Thank you.

SolidworksApi macros