Jump to content

Recommended Posts

Posted

I am not sure why this one plays up - If Rad = Radius - deduced previously from a selected circle. Why can't I set "MyValue" when the radius is at say 7.6?

Is it because I need a fudge factor or is there something else I am missing?

 

 

(if

(or

( = Rad 6.35)

( = Rad 7.6)

);or

 

(setq MyValue (* 2.0 rad))

);if

 

thanks

Posted

Hi,

 

It worked for me. I'll lay money the problem is your value for Rad is not what you think it is.

 

Have a good one.

Shawndoe

Posted

Yes but Rad for example when I look at value in the watch window is 7.6 yet it does not want to set "MyValue"

Perhaps its some other problem?

Posted

You could use equal instead of = as with = the two expressions must be identical to return true.

 

With equal you can specify a fuzz, say 0.0001 or something similar.

 

:thumbsup:

Posted

Probably a silly suggestion, but you might also want to consider your units. Even if a number determined via LISP has several places after the decimal point, viewing that number will be subject to the units of your drawing, and if you don't allow any more than, say, 1 digits after the decimal point to be displayed, any number that is 7.6whatever will display as 7.6.

Posted
You could use equal instead of = as with = the two expressions must be identical to return true.

 

With equal you can specify a fuzz, say 0.0001 or something similar.

 

:thumbsup:

 

I was going to suggest the same thing. I prefer (equal) to (=) in most cases concerning numeric values just for the fuzz :geek:

Posted
I was going to suggest the same thing. I prefer (equal) to (=) in most cases concerning numeric values just for the fuzz :geek:

 

Great minds think alike eh Tim... :P

Posted

I've heard that....... :shock:

Posted

thanks guys the fuzz factor seemed to do the trick using 'equal'

Posted

If you need differing fuzz factors you can use something like this:

 

Command: (setq r 2.6)
2.6

Command: (<= 2.599 r 2.6000000000001)
T

-David

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