im getting eLockViolation ?

im getting eLockViolation ?

Anonymous
Not applicable
847 Views
3 Replies
Message 1 of 4

im getting eLockViolation ?

Anonymous
Not applicable
greetings to all,

i am getting this error when i am trying to execute this sample code by calling it from a windows form
[see attached file of the sample code from 2010 .net developers guide]

the scenario
1. i write the sample code in a class1
2. (create some objects here in autocad app)
3. then i create a form1 and using button events to call the method "selectobjectsonscreen"
4. i get this elockviolation error
this line
[ ' Open the selected object for write
Dim acEnt As Entity = acTrans.GetObject(acSSObj.ObjectId, _
OpenMode.ForWrite)]


can anyone please explain why i am getting this error?
any workaround will be greatly appreciated

thanks in advance
0 Likes
848 Views
3 Replies
Replies (3)
Message 2 of 4

arcticad
Advisor
Advisor
The drawing needs to be locked.

{code}
Using lock As DocumentLock = acDoc.LockDocument
...
End Using
{code}
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 3 of 4

Anonymous
Not applicable
hi arcticad,

error resolved..

thank you very much..
0 Likes
Message 4 of 4

arcticad
Advisor
Advisor
Your Welcome.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes