Stephan
First, a big *thank you* for sharing PreventLockError.arx
I added Test4 to Roberts AcadDoc.lsp using A2Ki with "out of the box settings"
and as predicted, *bam* eLockViolation. Next I added Acad.RX calling
PreventLockError.arx, in separate drawings I ran Test2 then Test4, each worked.
The only note is that Test2 took about 30sec before the routine was complete.
I have been using PreventLockError since March, but the eLockViolation still
will occur (yes, I am a shade tree lisper). Last week one of the guys here keep
getting the eLockViolation when using my leader routine, I opened the dwg and
did a leader and *bam* eLockViolation. So I purged the dwg (out of frustration)
and to my surprise the eLockViolation went away, for now anyway (very strange).
Bill
"Stephan Koster" wrote in message
news:3BC22A64.BB560962@web.de...
> Robert,
>
> what you are talking about is part of the eLockViolation error.
> It is covered by a handful of threads is this group.
> Switching from (setvar) to (vla-SetVariable) doesn't help a
> lot because if (setvar) doesn't work AutoCAD is unstable
> and can crash when using (entmake).
> Add this to your AcadDoc.lsp:
>
> (defun c:test4 ()
> (command "._undo" "_g")
> (entmake '((0 . "POINT")(10 0 0 0)))
> (command "._undo" "_end")
> )
>
> When calling this as first command in a new drawing AutoCAD crashes
> immediately.
> One way to prevent all this hassle is using my PreventLockError.arx.
> You can find it in your thread "Releasing ActiveX objects *IMPORTANT*"
> from 01/09/19.
> Load it and run your tests again.
>
> Stephan
>
> P.S.: I am using A2Ki and don't know if the bug still exists in A2K2
>
> "R. Robert Bell" wrote:
> >
> > Well, it's Monday, so let's start with a deep bug to waken up the old brain
> > cells...
> >
> > It seems I'm caught like a squirrel on a road with a car coming in either
> > direction. Due to the large amount of customization I have done over the
> > years, I have far too much code to port fully to VBA or even full VL ActiveX
> > support in a brief period of time. So I do what any good programmer would
> > do, identify core subroutines that that can be improved by either VBA or
> > (vla-) functions.
> >
> > Until...
> >
> > This last week I switched my setvars/getvars to ActiveX (on my test bed) to
> > see if that stabilized AutoCAD any, as I was using ActiveX in much of my
> > core already. And it seemed to help. But just as I was getting ready to roll
> > that out, I ran a program (not just a core subr) that switches from model to
> > paperspace. In this program, I am still using (setvar). This program is used
> > to convert a R14 drawing to TuTu, so the users would run it upon opening a
> > drawing. And the 'cotton-pickin' stupid program crashed, never getting to
> > paperspace via (setvar "TileMode" 0). "What the...", I muttered, as it _had_
> > worked for weeks. Well, after 12 hours of debugging, I was able to replicate
> > the problem.
> >
> > There's something funky (and it ain't my socks) in AutoCAD's interpretive
> > processes. Here is the outline of the bug:
> > #1 Use (vla-SetVariable) in (S::StartUp)
> > #2 Use (vla-LoadDVB) in (S::StartUp) [this can even be a bogus load]
> > #3 Once in AutoCAD, use a lisp program that does the following:
> > #3a Use (command) or (vl-cmdf)
> > #3b Use (setvar)
> >
> > That last (setvar) will *not* be 'honored' by AutoCAD. Oh, (setvar) won't
> > error out, it thinks all is happy, but AutoCAD itself blissfully ignores
> > you. But, wait! there's more! Run you program again, and the (setvar) *is*
> > honored. Oh, joy... And if your program uses (vla-SetVariable) the bug is
> > avoided. Looks like I need to alter those 1000's of line of code after
> > all...
> >
> > For your further fun, I have included an AcadDoc.lsp file (remember,
> > S::StartUp is involved in the mess) that you can use to see "what's a
> > happenin' hotstuff".
> > (C:Test1) demonstrates the bug
> > (C:Test2) demonstrates the bug
> > (C:Test3) avoids the bug
> >
> > --
> > R. Robert Bell, MCSE
> > http://www.acadx.com
> >
>
------------------------------------------------------------------------------
----------------------
> > Name: AcadDoc.lsp
> > AcadDoc.lsp Type: AutoLISP Application source
(application/x-unknown-content-type-AutoLISPFile)
> > Encoding: quoted-printable