JWeyer Posted January 13, 2009 Author Posted January 13, 2009 The error msg pops up after clicking "OK" on the "Golfset" msg box, AND then moving the cursor to an area to start the first point of the centerline. As soon as the cursor "Snaps to a grip", then the "Unhandled Access Violation Exception" msg pops up. With OSNAP "Off", no grips are selected and thus no error msg... Quote
Lee Mac Posted January 13, 2009 Posted January 13, 2009 Hmmm... I can't quite see how the osnaps are causing the error, but I will be interested to see what CAB comes up with. Quote
CAB Posted January 13, 2009 Posted January 13, 2009 I eliminated all the other commands except the pline command. Also added some debug comments. Give this a try. You should see this at the command line. Command: golf "Making layers." Consruct Polyline: "Pline Entered by user." "Got a LWPolyline." "Updating Pline." "Pline update complete." "Adding Text." "Adding Flag Block." "Complete, exiting routine." Function Complete. Golf CL 06.LSP Quote
Lee Mac Posted January 13, 2009 Posted January 13, 2009 CAB, Have you just added a set of command line prints to the code or a whole debugging program? Quote
CAB Posted January 13, 2009 Posted January 13, 2009 I added prints to the command line throughout the code to allow the user to tell how far the code got by identifying the text at the command line. Quote
CAB Posted January 14, 2009 Posted January 14, 2009 Here is the latest version. I added code to place the text at the bisecting angle if the vertex. Also only alerts once per session. Golf CL 07.LSP Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 Just tried it CAB - I like the text placement, much better. Quote
JWeyer Posted January 14, 2009 Author Posted January 14, 2009 Thanks again for all the hard work and interest... I just tried "Golf CL 07.lsp" with osnap "off" and it works as expected. Turn osnap "on", move cursor around the screen and no problem, move cursor closer to expected tee location and bingo! Same error msg again in the same drawing... In case your are wondering about my operating system, I've attached screen shots just for info... Intel D915GEV mother board, 3.00 GHz, 2.87 MB RAM on XP (4.0 GB on VISTA), ATI FireGL V5000 GCard. I just tried to some tweaking on the video card but still experienced the same problem upon retesting. I really think that we are dealing with a problem within autocad, windows or my computer. I'm going to test this on my laptop and see what the results will be. I have a feeling that it will work on my laptop as expected. I suggest that you not waste any more effort on this elusive problem. Let's just turn "off" the osnap at the beginning and turn on at the end, if was on at the beginning, and move on... Thanks again, Jer Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 As a fix for now - I have updated the LISP to switch off the osnaps before constructing the pline - its not ideal, but it'll get you by. Golf CL 08.LSP Quote
JWeyer Posted January 14, 2009 Author Posted January 14, 2009 I believe that I've finally identified the root cause of the error problem. It's a "-pure virtual function call" from AutoCAD to the "Microsoft Visual C++ Runtime Library". (See Attached Image) The "Unhandled Exception Violation" will ALWAYS occur when the Osnap Setting "Nearest" is selected. Also, the "Unhandled Exception Violation" will SOMETIMES occur when the Osnap Setting "Apparent Int" is selected, depending on when you turn it "On" when drawing subsequent pline(s). I tested this while using just the pline command and the attached DWG file (Set your "Background" color to "DK Gray" for viewing my color settings) over, and over while using different Osnap setting. I found that AutoCAD would sometimes seem to "add" the "Nearest" setting. I don't know what version of MS C++ was used for R14, nor if, or when this problem was ever corrected. Later versions of AutoCAD may or may not have this same problem... I hope that this will help others that have had similar problems with Unhandled Exception errors... Have a great day! Jer TopoEndPts1.dwg Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 Blimey JWeyer, never heard of that error before - although you don't really know how many changes have occurred to C++ since R14 of ACAD, so there may well be some compatibility issues. Quote
CAB Posted January 14, 2009 Posted January 14, 2009 Lee Here is a better way as it doesn't reset the osmode but toggles them off. Quote
Lee Mac Posted January 14, 2009 Posted January 14, 2009 Using the old Boolean logic there CAB - very impressive. Quote
CAB Posted January 15, 2009 Posted January 15, 2009 Updated Version 8, corrected a bug. Please discard the old Version 8. Thanks Lee. Golf CL 08.LSP Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.