Copy and Paste Objects Fatal Error

Copy and Paste Objects Fatal Error

ChrisBatt
Advocate Advocate
2,575 Views
2 Replies
Message 1 of 3

Copy and Paste Objects Fatal Error

ChrisBatt
Advocate
Advocate

Hopefully someone can help me with this issue.  I am using Visual Studio 2010 and AutoCAD 2012 64bit on a Windows 7 64 bit machine 8GB of ram.  I am trying to copy a user selection and then paste the selection in another drawing or the same drawing based upon buttons on my form.  The user will specify a base point and then select all of the objects to copy.  I store the objects in a selection set so that the user could paste the selection multiple times into various drawings.  The copy works correctly and I get a selection set from which I obtain the objectIds along with a point to transform my objects.  My problem occurs during my paste routine.  The DeepCloneObjects or WblockCloneObjects seems to be working correctly and then I get into my code to transform the entities.  I'm also storing some information about the blocks so that I can manipulate our proprietary database later via another function call.  It seems like everything works correctly, but when I select a large number of objects I receive a fatal error. FATAL ERROR: Unhandled Access Violation Reading oxffbc4008 Exception at ed010939h.  It seems that the number of objects that people can copy varies on each user's computer.  I'm attaching my code in the hopes that someone can point out what I am doing incorrectly or help find an error.  Thanks for the assistance.

0 Likes
Accepted solutions (1)
2,576 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Hi Chris, I haven't looked into your specifics, but have you looked at the ADN Clipboard Manager Plugin of the Month? Perhaps this might provide some clues. I wonder if it handles things differently. Overview: http://through-the-interface.typepad.com/through_the_interface/2009/09/clipboard-manager-octobers-ad... The source code can be downloaded from Autodesk labs: http://labs.autodesk.com/utilities/ADN_plugins/catalog/ Hope this helps, Art
0 Likes
Message 3 of 3

ChrisBatt
Advocate
Advocate
Accepted solution

Alright, for anyone who was following this and might be having the same problems as I was.  Here is the solution.  It had to do with the way that I was storing the objects from the copy function (needed to store the ObjectIdCollection of the objects selected from the copy) along with the locking of the documents in the paste function (because I was not locking both databases when the copy/paste occurred between two drawings).  I'm posting my updated paste function in case anyone wants to see the solution.