RobotBuilder Deleting Code

I am using robot builder to learn command based programming but whenever I regenerate code it deletes all the code I have written. I am writing code outside of the autogenerated code area. Any suggestions?

is there an option in robotbuilder to build fresh vs doing an update? does it overwrite your code in all files or just some?

There aren’t any settings in roboBuilder that I can find. It only overwrites the code that it generates. So if it generates a command “Open Gripper” and I put custom code in it then regenerate it, it wipes the code.

Where is your code in the file? Can you post a screenshot of the file in Eclipse before and after you generate code?

There are two pictures. One is before the auto gen and one is after the auto gen. The before pic has the code I added.

Did you save your Eclipse project before robotbuilder generates the code? Try Ctrl-Shft-S in eclipse before going to robotbuilder. Or Ctrl-Shft-W and close all tabs and saving them if prompted before RobotBuilder.

That Step got me every time in the beginning. I now teach the new programmers this lesson but I warn them they will forget and learn the hard way. Its like saving before downloading or stepping away from the PC. The time your forget to the computer will freeze up.

I suspect RobotBuilder opens the file(currently saved on the disk) writes the changes then closes it. Eclipse now see the change and refreshes with the data on the disk that never had your edits.

I can’t duplicate this. Run robot builder from the command line and post the output. That would say whether RobotBuilder has incorrectly decided to overwrite the file or not.

So, when you generate a project with robot builder, it should give you comments along the lines of:


Anything between these two comments will be overwritten when you regenerate with Robotbuilder. If it is deleting code in other locations, then this is a bug.