Hi,
Andrew is correct on what you are trying to do.
The Robot program functionality is the only one that cannot be replicated via macro, this tab is the only one that can't be replicated, all other functions in PM Robot can be replicated in a macro though. You would have to write your own plugin to replicate this functionaly.
The first 3 tab menus; Robot Library, Robot Cell and Robot Control can be replicated via macro.
All you need to do is to Right Mouse click Macro in the explorer, on the open menu click record.

This will save a .mac file (pm macro commands will be displayed) for each click you make on PM Robot.
Right Mouse click Macro in the explorer, click stop to stop recording.
Look through the file to see what internal commands PM Robot uses. In theory all the functionality in these 3 tabs can be automated and replicated.
Note : click one PM Robot button at a time as the number of internal commands called is long!
I have a question.
Why are you trying to add home positions before an after in the NC program tab?
If it for simulation purposes - Because when you simulate the NC program, the NC program always starts and ends in the home position stored either in mtd file or in robot configuration form. If it does not, then something might be set up incorrectly in your virtual cell.
For post processing purposes - it is easier to add to the post a call for the HOME position at the start and end of the main file (main file calls subroutines) to make the robot go to that position if that is what is desired. The home position is a variable you can use anywhere in the file, this way you don't have to add the Home in the NC program at all.
I hope this helps.
Let me know if you need anything else.
Alexandre Pinto
Process Specialist