Results 1 to 8 of 8

Thread: divide by zero

  1. #1
    100 Club tomcarver's Avatar
    Join Date
    2015-11
    Location
    Tucker, GA
    Posts
    106
    Login to Give a bone
    0

    Default divide by zero

    Hello Cad people,
    I"m using a .lsp program that give me the error message "error: divide by zero".
    I have used this program successfully for years. Anyone know what could be causing the error?
    I hesitate to include the code because it's pretty long.

    Thanks
    Tom Goodman

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: divide by zero

    I moved this thread since you stated that it specifically involved lisp.

    Tom, if you don't include the lisp, please include some information. That's like saying "my car is making noise, how much will it take to fix it." If you don't want to paste the code into the post, attach it. Include information like, what you were doing at the time it errored, editor conditions.
    C:> ED WORKING....


    LinkedIn

  3. #3
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: divide by zero

    or if you cant post it, a name of the file might be good, the error you describe is similar to the one I get sometimes when using the pljoin express tool, or mpedit, then I just use a work around and manually join polylines using pedit.

  4. #4
    Active Member pferreira's Avatar
    Join Date
    2006-06
    Location
    Lisbon, Portugal
    Posts
    88
    Login to Give a bone
    0

    Default Re: divide by zero

    Quote Originally Posted by tom.g
    Hello Cad people,
    I"m using a .lsp program that give me the error message "error: divide by zero".
    I have used this program successfully for years. Anyone know what could be causing the error?
    I hesitate to include the code because it's pretty long.

    Thanks
    Tom Goodman
    Hello Tom
    The Divide by Zero is a very common error and sometimes it is difficult for the autolisp programmer to know were to check and resolve that error, but by my experience it is usually caused by polylines with two vertex's in the same coordinate, this error occurs when we try to evaluate two numbers, one number dividing it by zero!
    Well without the source code and an example it is difficult to know what is causing the error, but, if you are using polylines check if the don't have two vertex's in the same coordinate!

    Regards

  5. #5
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: divide by zero

    Quote Originally Posted by pferreira
    Hello Tom
    The Divide by Zero is a very common error and sometimes it is difficult for the autolisp programmer to know were to check and resolve that error, but by my experience it is usually caused by polylines with two vertex's in the same coordinate, this error occurs when we try to evaluate two numbers, one number dividing it by zero!
    Well without the source code and an example it is difficult to know what is causing the error, but, if you are using polylines check if the don't have two vertex's in the same coordinate!

    Regards
    overkill should eliminate the double vertex problem if that is the case

  6. #6
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: divide by zero

    Why involve overkill, polylines, express tool or whatever . . ?

    the main thing must be just "division by zero" in his code
    (/ 1 0 ) "Error: divide by zero"

    Tom, check your variables in your code, they may be zero.

    : ) Happy Computing !

    kennet

  7. #7
    Woo! Hoo! my 1st post
    Join Date
    2010-02
    Posts
    1
    Login to Give a bone
    0

    Talking Re: divide by zero

    Hi. Pferreira was right.
    The problem with "mpedit" happen because there are many lines with length zero.
    To solve this i used the "quick select" (qselect) chosing the object type "line", chosing the properties "length", keeping the operator "= Equals" and writing "0" (zero) to the value.
    All these line-points (lines with length zero) will be selected.
    Then you just delet this things. Thats fine, you will manage to use "mpedit" again.
    See you.
    Bye.

  8. #8
    100 Club
    Join Date
    2003-06
    Location
    North Dallas
    Posts
    168
    Login to Give a bone
    0

    Default Re: divide by zero

    If you're running AC2010 you can use the purge command. At the bottom of the window there's a check box for "Purge zero-length geometry and empty text objects." Might be faster than Quickselect.

Similar Threads

  1. Divide
    By theshell07 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2010-10-23, 07:27 AM
  2. How would I divide this?
    By nsinha73 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2009-03-24, 03:16 PM
  3. divide by zero
    By tom.g in forum AutoCAD General
    Replies: 0
    Last Post: 2007-07-05, 08:28 PM
  4. divide
    By marcknapen in forum Revit Architecture - General
    Replies: 6
    Last Post: 2005-12-02, 07:11 PM
  5. divide
    By eddy.lermytte in forum Revit Architecture - General
    Replies: 13
    Last Post: 2004-12-30, 06:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •