TheSwamp

Code Red => .NET => Topic started by: T.Willey on December 01, 2009, 06:10:49 PM

Title: Update non-current document
Post by: T.Willey on December 01, 2009, 06:10:49 PM
I was working on some code for my xref manager, and thought about adding this functionality to it, but I can't seem to get it to work if a drawing that is selected is open in the editor, but not current.  If it is current it will work just fine.  The error I'm getting is an ' eLockViolation ', and I can't seem to find a way to get rid of it.

The code is locking the document it is called in.
The code is being executed after the dialog has been closed.
Acad '06, .Net 2.0.
Title: Re: Update non-current document
Post by: MickD on December 01, 2009, 06:47:50 PM
Have you tried getting the drg db you want to work on and then lock that doc before calling any update code?
just a thought...
Title: Re: Update non-current document
Post by: T.Willey on December 01, 2009, 06:53:03 PM
Have you tried getting the drg db you want to work on and then lock that doc before calling any update code?
just a thought...

I did not.  I had it stuck in my head, that locking the document was only used for the current document, but it worked just fine.  Thanks Mick!  I don't know if I ever would have tried that.  Seems so simple now.....
Title: Re: Update non-current document
Post by: MickD on December 01, 2009, 08:35:34 PM
"The code is locking the document it is called in."

No prob's, that line above was the clue ;)