Author Topic: Update non-current document  (Read 2259 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Update non-current document
« 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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Update non-current document
« Reply #1 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...
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Update non-current document
« Reply #2 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.....
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Update non-current document
« Reply #3 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 ;)
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien