Jump to content
anandhan

dimension value fixing problem in simple lisp

Recommended Posts

anandhan

(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

Share this post


Link to post
Share on other sites
ReMark

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.

Share this post


Link to post
Share on other sites
anandhan

Yes same problem I am also facing :cry:

Share this post


Link to post
Share on other sites
Tharwat

Replace the command "dim1" with this line of codes .

 

(entmod (subst (cons 1 (itoa ab)) (assoc 1 (entget (car obj))) (entget (car obj))))

Share this post


Link to post
Share on other sites
anandhan

thank you Tharwat, its working :)

Share this post


Link to post
Share on other sites
Tharwat
thank you Tharwat, its working :)

 

Happy to know and you're very welcome :)

Share this post


Link to post
Share on other sites
Lee Mac
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.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...