Results 1 to 9 of 9

Thread: Zero length line created when lisp is run

  1. #1
    Member
    Join Date
    2005-05
    Posts
    3
    Login to Give a bone
    0

    Default Zero length line created when lisp is run

    When I run an AutoLISP called thd.lsp on one of the engineering computers, I get " Zero line length created at (...,...,....) etc. and I get a garbled output to the screen. The lisp runs perfectly on other computers. I reinstalled Autocad but it didn't help. Does anyone know of a solution?

  2. #2
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: Zero length line created when lisp is run

    Quote Originally Posted by tommy.malone
    When I run an AutoLISP called thd.lsp on one of the engineering computers, I get " Zero line length created at (...,...,....) etc. and I get a garbled output to the screen. The lisp runs perfectly on other computers. I reinstalled Autocad but it didn't help. Does anyone know of a solution?
    Without seeing the code I can only guess, but it's often a problem of the endpoint snapping to the startpoint. Change OSNAPCOORD to 2 and/or turn off osnaps in the lisp. It could also be a situation where internal math sometimes results in the startpoint and endpoint being the same but since it only happens on one machine, I'm betting on OSNAPCOORD.
    Last edited by scwegner; 2005-05-26 at 04:26 PM.

  3. #3
    Member
    Join Date
    2005-05
    Posts
    3
    Login to Give a bone
    0

    Default Re: Zero length line created when lisp is run

    I turned off Osnap and the lisp runs perfectly. I do not know how to turn it off and the back on again inside the code. I have attached thd.lsp. Please look at it and if you can, tell what code to add.
    Thanks
    Attached Files Attached Files

  4. #4
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: Zero length line created when lisp is run

    Here you go. I annotated the changes so you can see them. The program could still use some additional work -an error handler for example.
    Also, keeping OSNAPCOORD at 1 or 2 would make it a moot point anyway.
    Attached Files Attached Files

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

    Default Re: Zero length line created when lisp is run

    Quote Originally Posted by scwegner
    . . . The program could still use some additional work -an error handler . . .
    . . .and You forgot to make the oosmode variable local for the function
    (defun C:THD (/ oosmode .....

    : ) Happy Computing !

    kennet

  6. #6
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: Zero length line created when lisp is run

    Quote Originally Posted by kennet.sjoberg
    . . .and You forgot to make the oosmode variable local for the function
    (defun C:THD (/ oosmode .....

    : ) Happy Computing !

    kennet
    Oh, right. Oops. Tommy, in case what he said makes no sense, change:

    (/ cl dia n ang len radius rang pang tang p nt tcnt a b c d e f g h blipsave)

    To:

    (/ cl dia n ang len radius rang pang tang p nt tcnt a b c d e f g h blipsave oosmode)

  7. #7
    Member
    Join Date
    2005-05
    Posts
    3
    Login to Give a bone
    0

    Default Re: Zero length line created when lisp is run

    Thanks to both of you. You guys are a lot smarter than I am.

  8. #8
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Zero length line created when lisp is run

    I'm not a big fan of changing OSMode, as the rest of the posts indicate. What if the user wanted to use their running OSnaps for part of the selection process?

    Therefore, it is far easier, IMHO, to simply force the NONe mode when stuffing the command pipeline.
    Code:
    (setq pt1 (getpoint "\nSpecify first point: "))
    (setq pt2 (getpoint pt1 "\nSpecify next point: "))
    (command "._Line" "_non" pt1 "_non" pt2 "")

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

    Default Re: Zero length line created when lisp is run

    Quote Originally Posted by RobertB
    . . .What if the user wanted to use their running OSnaps for part of the selection process?. . .
    In this case the user have no chance to affect the "selection process" because the "command line" is running inside the lisp program already feeded with coordinates.

    "Code:"
    (setq oosmode (getvar "osmode"))
    (setvar "osmode" 0)
    a lot of calculating . . .
    (command "line" X Y "") . . . repeated many times
    (setvar "osmode" oosmode)

    : ) Happy Computing !

    kennet
    Last edited by kennet.sjoberg; 2005-06-01 at 06:03 AM.

Similar Threads

  1. Replies: 14
    Last Post: 2015-05-21, 02:02 AM
  2. 2012: Problem with Line styles created not showing up in detail line list
    By mark.moore678826 in forum Revit Architecture - General
    Replies: 0
    Last Post: 2012-11-26, 07:16 PM
  3. Type Line Length When Sketching Line
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 2
    Last Post: 2012-11-07, 04:56 AM
  4. Enter length AND angle of line or wall when it is being created
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2012-09-27, 02:13 PM
  5. Lisp routine to list line length and line ID
    By hlecates in forum AutoLISP
    Replies: 6
    Last Post: 2007-03-21, 04:03 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
  •