Jump to content

dimension value fixing problem in simple lisp


anandhan

Recommended Posts

(defun c:test ()

 (setq obj (entsel "please select the dimension:-"))
 (setq ab  (fix(getreal "please enter the value to change:-" )))

 (command "dim1" "new" ab obj "")

 (princ)

 )

 

 

hi friends

 

if i try to fix value more than 32600 it will fixed automatically some other value please help me

 

what is the reason for this?

Edited by anandhan
Link to comment
Share on other sites

I was able to change a value all the way up to 32599 with no problem. As soon as I tried 33000 the value changed to -32536. That's weird.

 

You're working in metric units I presume?

 

By the way,you might want to change the spelling of the following words so it reads correctly.

 

dimention --> dimension

 

enther --> enter

chang --> change

 

Now that I think on it some more you might also want to change this line Please enter the value to change to... Please enter the new value. The difference is subtle but I think it is more correct. Just a suggestion.

Link to comment
Share on other sites

if i try to fix value more than 32600 it will fixed automatically some other value please help me

 

what is the reason for this?

 

Actually, the limit is 32767 or (2^15)-1 - this is the upper-limit for a signed 16-bit integer; values higher than this will flip the sign bit and will result in values increasing from -32768.

 

This is a remnant from early releases of AutoCAD in which 16-bit signed integers were used as standard (you see the same limit when prompting for an integer using the getint function).

 

Nowadays, integers are represented using 32-bit or even 64-bit signed integers, giving upper-limits of 2,147,483,647 & 9,223,372,036,854,775,807 respectively.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...