Exception Error
Exception Error
(OP)
Hey, I am Stumped!
I created a templates with drawing limits that I use with many of my drawings.
I have several VBA codes that I run ( From menus and or Buttons) on different
data to display on these templates. One macro is causing AutoCAD to crush every
time with the error:
Exception Occurred 0xc0000005(Access Violation).
However, if I open the macro in VBAIDE with the same templates it run properly.
I can also run the same macro on a blank acad.dwt template with no problems.
These seems to be no pattern to the crashes. Sometimes it does, sometimes it does not.
Please help, I do not know what to do? Is there someway to fix this?
I created a templates with drawing limits that I use with many of my drawings.
I have several VBA codes that I run ( From menus and or Buttons) on different
data to display on these templates. One macro is causing AutoCAD to crush every
time with the error:
Exception Occurred 0xc0000005(Access Violation).
However, if I open the macro in VBAIDE with the same templates it run properly.
I can also run the same macro on a blank acad.dwt template with no problems.
These seems to be no pattern to the crashes. Sometimes it does, sometimes it does not.
Please help, I do not know what to do? Is there someway to fix this?





RE: Exception Error
Couple of questions - What version of VBA and ACAD are you using? Currently, there is no documentation from Autodesk on VBA.NET that indicates there are a one-to-one correspendence on which version of ACAD is compatable! I don't know when Autodesk will clear up this fog. Hope this helps - John
RE: Exception Error
I seem to have found the error that is causing it to tank! I keep getting an "Automation error(440) The object involved has disconected from its client" when it gets to setting the point mode and size
ThisDrawing.SetVariable "PDMODE", 98
ThisDrawing.SetVariable "PDSIZE", 4
I moved this around to the start of the code to draw and it seems to be woring well now.
Would anyone know by chance why this was happening so that next time I have a clue what to do? :)
RE: Exception Error
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: Exception Error
No I don't switch active drawing sheets in the code. All drawing is done in Modelspace.
I figured out that the disconnection occurred as the drawing and the point setting were in different places.
The code in the click_event calls a sub the draws the point. Within this event, after the draw sub, was the point setting. This is the point the automation error occurred and then everything would crush creating an Exception error.