Power Rail automatically create alignment

Hello, I have the following issue:

I want to call Power Rail via Matlab(programing language) in batch mode, insert some coordinate points and a surface and then Power Rail create a horizontal and vertical alignment and export the earthworks or the total cost. I have already learned how to insert points, create an alignment and compute the earthworks through GUI(manualy). Therefore, I need this procedure to be performed automatically via an automated process throughout macros or scripts. Can anyone help?

Thank you!