Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

error: Exception occurred: 0xC0000005 (Access Violation)

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
856 Views, 4 Replies

error: Exception occurred: 0xC0000005 (Access Violation)

Using the snippet of code below, I get this error only on some layouts (not Model). Anyone seen this? Restoring cached viewports - Regenerating layout. Regenerating 948 modified entities. ; error: Exception occurred: 0xC0000005 (Access Violation) ; warning: unwind skipped on unknown exception (setq plotobj (vla-get-plot *adoc*)) (foreach x laylist (setq l-out (vla-item *layouts* x)) (vla-RefreshPlotDeviceInfo l-out) (vla-put-configname l-out (dos_getprn)) (vla-put-canonicalmedianame l-out "11x17") (vla-put-activelayout *adoc* l-out) (vla-plottodevice plotobj nil) ) -- Ken Alexander Acad2004 Windows2000 Prof. "We can't solve problems by using the same kind of thinking we used when we created them." --Albert Einstein
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Hi Ken, I've seen that error (or very similar) more than once but don't remember the exact situations. As you well know, you could wrap each vla statement in a catch all apply then read back the error-message to see which ones triggering it...course that may not explain why but it may give a direction to look... is the error consistent with the certain layouts? is it happening in a long loop of dwgs? couldn't be some weird memory issue? obviously you've confirmed each item in laylist is a valid layout name...hmmm what else could it be? (defun testforken() ;(or Getlayoutlist(load"LayoutFuncs")) (setq plotobj (vla-get-plot *doc*)) ;(setq laylist(GetLayoutList)) ;(or usedoslib (load"UtilFuncs")) ;(usedoslib) (foreach x laylist (if(vl-catch-all-error-p (setq l-out (vl-catch-all-apply 'vlax-invoke-method (list *layouts* 'item x))) );err (princ(vl-catch-all-error-message l-out)) (princ"\nItem method ok") ) (if(vl-catch-all-error-p (setq res (vl-catch-all-apply 'vla-RefreshPlotDeviceInfo (list l-out)))) (princ(vl-catch-all-error-message res)) (princ"\nRefreshPlotDeviceInfo ok") ) (if(vl-catch-all-error-p (setq res (vl-catch-all-apply 'vla-put-configname(list l-out (dos_getprn))))) (princ(vl-catch-all-error-message res)) (princ"\nput-configname ok") ) (if(vl-catch-all-error-p (setq res (vl-catch-all-apply 'vla-put-canonicalmedianame (list l-out "Letter"))));I had to change to letter for this printer (princ(vl-catch-all-error-message res)) (princ "\nput-canonicalmedianame ok") ) (if(vl-catch-all-error-p (setq res (vl-catch-all-apply 'vla-put-activelayout (list *doc* l-out)))) (princ(vl-catch-all-error-message res)) (princ"\nput active layout ok") ) (if(vl-catch-all-error-p (setq res (vl-catch-all-apply 'vla-plottodevice (list plotobj nil)))) (princ(vl-catch-all-error-message res)) (princ"\nplot to device ok") ) ) (princ) ) returned Item method ok RefreshPlotDeviceInfo ok put-configname ok put-canonicalmedianame ok put active layout ok plot to device ok for both layouts of a test dwg I had previously plotted from the two layouts manually to set the plot device "Ken Alexander" wrote in message news:40351c9d_3@newsprd01... > > Using the snippet of code below, I get this error only on some > layouts (not Model). Anyone seen this? > > Restoring cached viewports - Regenerating layout. > Regenerating 948 modified entities. > ; error: Exception occurred: 0xC0000005 (Access Violation) > ; warning: unwind skipped on unknown exception > > (setq plotobj (vla-get-plot *adoc*)) > (foreach x laylist > (setq l-out (vla-item *layouts* x)) > (vla-RefreshPlotDeviceInfo l-out) > (vla-put-configname l-out (dos_getprn)) > (vla-put-canonicalmedianame l-out "11x17") > (vla-put-activelayout *adoc* l-out) > (vla-plottodevice plotobj nil) > ) > > -- > Ken Alexander > Acad2004 > Windows2000 Prof. > > "We can't solve problems by using the same kind > of thinking we used when we created them." > --Albert Einstein > > >
Message 3 of 5
Anonymous
in reply to: Anonymous

Mark, It's not consistent with certain layouts. At least I don't think so. I don't get the error but one or two times every couple weeks. I use this routine daily. Laylist is valid. I'm leaning toward one of two things. 1) I used this routine for almost a year using Acad2000 and dos_lib 2k. No problems Now I'm using Acad2004 and dos_lib 2004. Maybe something there. 2) Memory. I've got 512 meg and 4X that in virtual Memory. Hard to pin point a cause. Thanks for your time on this. -- Ken Alexander Acad2004 Windows2000 Prof. "We can't solve problems by using the same kind of thinking we used when we created them." --Albert Einstein "Mark Propst" wrote in message news:4035b508_1@newsprd01... > Hi Ken, > I've seen that error (or very similar) more than once but don't remember the > exact situations. > As you well know, you could wrap each vla statement in a catch all apply > then read back the error-message to see which ones triggering it...course > that may not explain why but it may give a direction to look... > is the error consistent with the certain layouts? is it happening in a long > loop of dwgs? couldn't be some weird memory issue? > obviously you've confirmed each item in laylist is a valid layout > name...hmmm what else could it be? > > > (defun testforken() > ;(or Getlayoutlist(load"LayoutFuncs")) > (setq plotobj (vla-get-plot *doc*)) > ;(setq laylist(GetLayoutList)) > ;(or usedoslib (load"UtilFuncs")) > ;(usedoslib) > (foreach x laylist > (if(vl-catch-all-error-p > (setq l-out > (vl-catch-all-apply > 'vlax-invoke-method (list *layouts* 'item x))) > );err > (princ(vl-catch-all-error-message l-out)) > (princ"\nItem method ok") > ) > (if(vl-catch-all-error-p > (setq res > (vl-catch-all-apply > 'vla-RefreshPlotDeviceInfo (list l-out)))) > (princ(vl-catch-all-error-message res)) > (princ"\nRefreshPlotDeviceInfo ok") > ) > (if(vl-catch-all-error-p > (setq res > (vl-catch-all-apply > 'vla-put-configname(list l-out (dos_getprn))))) > (princ(vl-catch-all-error-message res)) > (princ"\nput-configname ok") > ) > (if(vl-catch-all-error-p > (setq res > (vl-catch-all-apply > 'vla-put-canonicalmedianame (list l-out "Letter"))));I had to change > to letter for this printer > (princ(vl-catch-all-error-message res)) > (princ "\nput-canonicalmedianame ok") > ) > (if(vl-catch-all-error-p > (setq res > (vl-catch-all-apply > 'vla-put-activelayout (list *doc* l-out)))) > (princ(vl-catch-all-error-message res)) > (princ"\nput active layout ok") > ) > (if(vl-catch-all-error-p > (setq res > (vl-catch-all-apply > 'vla-plottodevice (list plotobj nil)))) > (princ(vl-catch-all-error-message res)) > (princ"\nplot to device ok") > ) > > ) > (princ) > ) > > returned > Item method ok > RefreshPlotDeviceInfo ok > put-configname ok > put-canonicalmedianame ok > put active layout ok > plot to device ok > > for both layouts of a test dwg > I had previously plotted from the two layouts manually to set the plot > device > > "Ken Alexander" wrote in message > news:40351c9d_3@newsprd01... > > > > Using the snippet of code below, I get this error only on some > > layouts (not Model). Anyone seen this? > > > > Restoring cached viewports - Regenerating layout. > > Regenerating 948 modified entities. > > ; error: Exception occurred: 0xC0000005 (Access Violation) > > ; warning: unwind skipped on unknown exception > > > > (setq plotobj (vla-get-plot *adoc*)) > > (foreach x laylist > > (setq l-out (vla-item *layouts* x)) > > (vla-RefreshPlotDeviceInfo l-out) > > (vla-put-configname l-out (dos_getprn)) > > (vla-put-canonicalmedianame l-out "11x17") > > (vla-put-activelayout *adoc* l-out) > > (vla-plottodevice plotobj nil) > > ) > > > > -- > > Ken Alexander > > Acad2004 > > Windows2000 Prof. > > > > "We can't solve problems by using the same kind > > of thinking we used when we created them." > > --Albert Einstein > > > > > > > > > >
Message 4 of 5
liftedaxis
in reply to: Anonymous

Ken,
I get those a lot, they seem to be related to a database conflict. 90+% of the time, reinstalling MDAC fixes the problem. go to microsoft.com, search for mdac, and download and install version 2.8.
--Jeremiah
Message 5 of 5
Anonymous
in reply to: Anonymous

Thanks Jeremiah, I give it a look. -- Ken Alexander Acad2004 Windows2000 Prof. "We can't solve problems by using the same kind of thinking we used when we created them." --Albert Einstein "liftedaxis" wrote in message news:13204613.1077305248701.JavaMail.jive@jiveforum2.autodesk.com... > Ken, > I get those a lot, they seem to be related to a database conflict. 90+% of the time, reinstalling MDAC fixes the problem. go to microsoft.com, search for mdac, and download and install version 2.8. > --Jeremiah

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost