Results 1 to 7 of 7

Thread: error: bad argument value: positive 0

  1. #1
    Active Member
    Join Date
    2007-09
    Location
    Croatia
    Posts
    55
    Login to Give a bone
    0

    Default error: bad argument value: positive 0

    Can someone please explain the term:
    positive 0

    ???

    Thanks in advance!

  2. #2
    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: error: bad argument value: positive 0

    I haven't seen that before. If you posted the code causing the error that might help us.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    Active Member
    Join Date
    2007-09
    Location
    Croatia
    Posts
    55
    Login to Give a bone
    0

    Default Re: error: bad argument value: positive 0

    Quote Originally Posted by RobertB View Post
    I haven't seen that before. If you posted the code causing the error that might help us.



    ,......

    (setq tex(rtos(setq tex 2.0)2 2))
    (setq tex (substr tex (- (strlen tex) 4)))

    ,......
    ; now i see, substr must have positive argument !!

  4. #4
    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: error: bad argument value: positive 0

    Quote Originally Posted by marijan.marsic View Post
    ,......

    (setq tex(rtos(setq tex 2.0)2 2))
    (setq tex (substr tex (- (strlen tex) 4)))
    (rtos(setq tex 2.0)2 2) only returns 2 on my system, so you cant get a substring of "2" starting at the -3 character.

    If you want to use this function, I would suggest adding a check that the string length is longer than 4.
    Code:
    (if (>= 4 (strlen tex))
    (setq tex (substr tex (- (strlen tex) 4)))
    )

  5. #5
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: error: bad argument value: positive 0

    Quote Originally Posted by ccowgill View Post
    (rtos(setq tex 2.0)2 2) only returns 2 on my system, so you cant get a substring of "2" starting at the -3 character.

    If you want to use this function, I would suggest adding a check that the string length is longer than 4.
    Code:
    (if (>= 4 (strlen tex))
    (setq tex (substr tex (- (strlen tex) 4)))
    )
    If you are losing trailing/leading zeros, check your dimzin variable.

  6. #6
    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: error: bad argument value: positive 0

    Quote Originally Posted by alanjt View Post
    If you are losing trailing/leading zeros, check your dimzin variable.
    currently set to not display leading or trailing zeros (12) that is good information to help me out with some of my programs. That also leaves a valid point for the OP's question, a check should be made ahead of time to make sure that zeros are not suppressed on a users system when the command is run.

  7. #7
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: error: bad argument value: positive 0

    Quote Originally Posted by ccowgill View Post
    currently set to not display leading or trailing zeros (12) that is good information to help me out with some of my programs. That also leaves a valid point for the OP's question, a check should be made ahead of time to make sure that zeros are not suppressed on a users system when the command is run.
    We keep our dimzin set at 12 also. It's nice for dimension labels, but such a pain to take into account when coding.

Similar Threads

  1. Replies: 4
    Last Post: 2009-05-22, 05:21 AM
  2. Error: bad argument type: lselsetp nil
    By stusic in forum AutoLISP
    Replies: 1
    Last Post: 2008-02-20, 10:02 PM
  3. Replies: 8
    Last Post: 2007-01-03, 02:32 PM
  4. Replies: 3
    Last Post: 2006-12-11, 08:31 PM
  5. error: bad point argument
    By ReachAndre in forum AutoLISP
    Replies: 6
    Last Post: 2006-09-25, 08:12 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
  •