TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: SMadsen on December 10, 2003, 08:51:34 AM
-
Messing with the dimension search program in another thread, I stumbled on a bug that doesn't seem to be described in the knowledge base. Just thought I'd share it here.
When restoring the active viewport in Modelspace with VLA-PUT-ACTIVEVIEWPORT, make sure that no entities are gripped.
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq vp (vla-get-activeviewport doc))
(vla-put-activeviewport doc vp)
^this works fine if no entities are gripped (that is, SSGETFIRST returns nil's). Having entities gripped, it will look something like this:
(vla-put-activeviewport doc vp)
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on unknown exception
.. and issue a FATAL ERROR, for example: UAV Reading 0x0004 Exception at 33ed2f86h
To work around it, call (SSSETFIRST nil nil) before restoring the viewport.
-
Thanks SMadsen.
-
Now that really sucks now don't it...
I will make note of it.
Oh, and I KNOW that you reported it to Autodork
-
vl-catch-all-apply doesn't help either.
-
Would this work too?
(COMMAND)
-
It might, but you wouldn't want to do that in an ActiveX environment.
-
Oh, forgot you shouldn't mix the two.