NathTay on the Autodesk discussion groups came up with the steps below. I followed them and it all seems to be working now. Thanks for everyones help
These are the steps I use.
1. Create global variable as ObjectIdCollection
2. In CommandWillStart Event Handler if command name is a command that can result in copies being produced instantiate the global variable.
3. In ObjectAppended Event Handler check "CMDNAMES" system variable if command is same as checked for in Step 2 add objects to global variable.
4. In CommandCancelled or CommandEnded Event Handlers if it is the relevant command process the global variable and then set it to nothing.