.NET

Reply
Contributor
ChrisBatt
Posts: 12
Registered: ‎11-21-2011
Message 1 of 3 (620 Views)
Accepted Solution

Copy and Paste Objects Fatal Error

620 Views, 2 Replies
11-21-2011 05:08 AM

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.

Distinguished Contributor
Artvegas
Posts: 104
Registered: ‎04-21-2011
Message 2 of 3 (591 Views)

Re: Copy and Paste Objects Fatal Error

11-27-2011 09:10 PM in reply to: ChrisBatt
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
Contributor
ChrisBatt
Posts: 12
Registered: ‎11-21-2011
Message 3 of 3 (541 Views)

Re: Copy and Paste Objects Fatal Error

02-20-2012 04:37 AM in reply to: Artvegas

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.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.