M76 Posted January 27, 2010 Share Posted January 27, 2010 Sometimes I get this message when running a lisp. But i cannot find the cause, it doesn't even break the code, so I have no idea where to look for the error, or see what goes wrong. Any way to force it to break the execution of the code? Or any idea what can cause this message to appear? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 27, 2010 Share Posted January 27, 2010 It can be a number of things - using a method/property that doesn't apply for example. You could use the Visual LISP Editor to Debug your code to see where the error occurs. Visual LISP Editor: http://www.afralisp.net/vl/vlisp.htm http://www.afralisp.net/vl/vl-edit.htm http://midpointcad.com/au/docs/lakose_The_Visual_LISP_Developers_Bible.pdf Quote Link to comment Share on other sites More sharing options...
M76 Posted January 27, 2010 Author Share Posted January 27, 2010 That's the problem, I'm using visual lisp editor, but the code execution is not stopped when the message appears. So when I select last break, it shows nothing. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 27, 2010 Share Posted January 27, 2010 Could you not use a break-point (near to where you believe the error to be) and then animate to see where the code evaluation stops? Else, post the code on here and I'll have a look Quote Link to comment Share on other sites More sharing options...
M76 Posted January 27, 2010 Author Share Posted January 27, 2010 I've figured it out, its not a problem with the code. I'm offsetting polylines, and the error comes when the line can't be offset. I'm using vla-offset, so how can I detect this, and avoid getting the message? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 27, 2010 Share Posted January 27, 2010 I used that method in this code: http://www.cadtutor.net/forum/showthread.php?t=42427 You can make use of vl-catch-all-apply to allow for when offsetting is not possible. Quote Link to comment Share on other sites More sharing options...
M76 Posted January 29, 2010 Author Share Posted January 29, 2010 Thanks that's what I needed, unfortunately I don't have time to implement it now, but at least I know how to. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 29, 2010 Share Posted January 29, 2010 You're welcome Quote Link to comment Share on other sites More sharing options...
itssme Posted October 13, 2012 Share Posted October 13, 2012 Hi all, I am studying lisp, and i got an example in Help of Autocad 2008 (Developer documentation). That is: (defun init-motivate () (vl-load-com) (setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)) ) ) (vla-addray mspace (vlax-3d-point 0 0 0) (vlax-3d-point 1 1 0))) and (defun bnddrop (/ bbox) (setq bbox (vla-getboundingbox (vla-item mspace (- 1 (vla-get-count mspace))) 'll 'ur ) ) (list "Do something with bounding box." bbox)) Ok, a Ray object is created, but (bnddrop) responsed an error that not like in its example (; error: Automation Error. Invalid extents). Errors is "; error: Automation Error. Description was not provided." Why is it? Thanks for helps! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 13, 2012 Share Posted October 13, 2012 A Ray object extends to 'infinity' in a given direction, and hence has no valid extents. Quote Link to comment Share on other sites More sharing options...
itssme Posted October 13, 2012 Share Posted October 13, 2012 I see, but the error is not like "Invalid extents". Error is "; error: Automation Error. Description was not provided." Meaning of this, the error is responsed different from the error of Autodesk's example. Why? Thank you! This is a report from Command line: Command: c CIRCLE Specify center point for circle or [3P/2P/Ttr (tan tan radius)]: Specify radius of circle or [Diameter]: Command: (defun init-motivate () (_> (vl-load-com) (_> (setq mspace ((_> (vla-get-modelspace (((_> (vla-get-activedocument (vlax-get-acad-object)) (((_> ) ((_> ) (_> (vla-addray mspace (vlax-3d-point 0 0 0) (vlax-3d-point 1 1 0)) (_> ) INIT-MOTIVATE Command: '_.zoom _e Command: (defun bnddrop (/ bbox) (_> (setq bbox (vla-getboundingbox (((_> (vla-item mspace (- 1 (vla-get-count mspace))) (((_> 'll (((_> 'ur (((_> ) ((_> ) (_> (list "Do something with bounding box." bbox) (_> ) BNDDROP Command: (INIT-MOTIVATE) # Command: (BNDDROP) ; error: Automation Error. Description was not provided. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 13, 2012 Share Posted October 13, 2012 Try: (defun c:test ( / lowerleft upperright ) (vla-getboundingbox (vla-addray (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3D-point 0.0 0.0) (vlax-3D-point 1.0 0.0) ) 'lowerleft 'upperright ) (princ) ) (vl-load-com) (princ) PS: Please edit your post and enclose your code with code tags: [highlight][noparse] [/noparse][/highlight] Your code here [highlight][noparse] [/noparse][/highlight] Quote Link to comment Share on other sites More sharing options...
itssme Posted October 14, 2012 Share Posted October 14, 2012 Ok, the matter is here: ( / lowerleft upperright ) and 'lowerleft 'upperright Thanks Lee, Lee Mac programing is very wonderful. I like it! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 14, 2012 Share Posted October 14, 2012 Thanks Lee, Lee Mac programing is very wonderful. I like it! Thanks! Quote Link to comment Share on other sites More sharing options...
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.