TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: SMadsen on December 10, 2003, 08:51:34 AM

Title: Bug report - setting viewport while gripped ents
Post 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.
Title: Bug report - setting viewport while gripped ents
Post by: Mark on December 10, 2003, 09:07:31 AM
Thanks SMadsen.
Title: Bug report - setting viewport while gripped ents
Post by: Keith™ on December 10, 2003, 09:12:33 AM
Now that really sucks now don't it...
I will make note of it.

Oh, and I KNOW that you reported it to Autodork
Title: Bug report - setting viewport while gripped ents
Post by: Mark on December 10, 2003, 09:51:40 AM
vl-catch-all-apply doesn't help either.
Title: Bug report - setting viewport while gripped ents
Post by: CAB on December 10, 2003, 04:58:04 PM
Would this work too?

 (COMMAND)
Title: Bug report - setting viewport while gripped ents
Post by: daron on December 10, 2003, 06:06:56 PM
It might, but you wouldn't want to do that in an ActiveX environment.
Title: Bug report - setting viewport while gripped ents
Post by: CAB on December 10, 2003, 07:05:24 PM
Oh, forgot you shouldn't mix the two.