Author Topic: Getting BlockTableRecord for Write  (Read 2733 times)

0 Members and 1 Guest are viewing this topic.

Proctor

  • Guest
Getting BlockTableRecord for Write
« on: April 02, 2008, 04:03:47 PM »
Hello: If I make a call to a sub via the command prompt, this line works fine:

myBTR = myBT(BlockTableRecord.ModelSpace).GetObject(OpenMo de.ForWrite)

but....if after i open my app in autocad with an open form and on click of a button, i make a call to the same sub...it bombs on this same line.

Thanks,
Proctor

Glenn R

  • Guest
Re: Getting BlockTableRecord for Write
« Reply #1 on: April 02, 2008, 05:04:40 PM »
Hello: Modeless form?

Thanks,

MickD

  • King Gator
  • Posts: 3666
  • (x-in)->[process]->(y-out) ... simples!
Re: Getting BlockTableRecord for Write
« Reply #2 on: April 02, 2008, 05:39:06 PM »
Don't forget document locking also ;)
"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

Glenn R

  • Guest
Re: Getting BlockTableRecord for Write
« Reply #3 on: April 02, 2008, 05:43:13 PM »
Ssssh Mick...I'm trying to lead him into that realisation so he realises the context :)

MickD

  • King Gator
  • Posts: 3666
  • (x-in)->[process]->(y-out) ... simples!
Re: Getting BlockTableRecord for Write
« Reply #4 on: April 02, 2008, 06:18:28 PM »
oops...sorry to spoil the fun Glenn, carry on :)
"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

Proctor

  • Guest
Re: Getting BlockTableRecord for Write
« Reply #5 on: April 02, 2008, 08:07:33 PM »
It's working!!! I was opening my form Modeless so changed it to Model but still didn't work; after which, I switched back to Modeless and added the line:

Application.DocumentManager.MdiActiveDocument.LockDocument(DocumentLockMode.AutoWrite, Nothing, Nothing, True) to my proc...and it worked like a charm!!


Thanks to you both for the great insite.

Proctor

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2159
  • class keyThumper<T>:ILazy<T>
Re: Getting BlockTableRecord for Write
« Reply #6 on: April 02, 2008, 10:31:46 PM »

[quiet smile at Glenn's teaching methods]
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

Glenn R

  • Guest
Re: Getting BlockTableRecord for Write
« Reply #7 on: April 03, 2008, 05:24:05 AM »
 :-D