Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

if statement problem:

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
delliston
405 Views, 3 Replies

if statement problem:

OK, I thought I could use the "if" statement to say the following: (if userdimscale 15.0 (setvar dimscale 6.0)), in english, if userdimscale equals 15.0 then set dimscale to 6.0. so, what's wrong with that it doesn't work?

3 REPLIES 3
Message 2 of 4
dgorsman
in reply to: delliston

I'm not seeing a comparison operation in there...

 

(if ...) takes one comparison expression, one "if true" expression, and one "if false" expression:

 

(if (= 15.0 some_number)
   (foo_true)
   (foo_false)
)

 

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 3 of 4
delliston
in reply to: dgorsman

OOPS, forgot the = sign

Thanks
Message 4 of 4
Kent1Cooper
in reply to: delliston


@Anonymous wrote:
OOPS, forgot the = sign

... as well as the parentheses enclosing the (=) function, and either an apostrophe ' preceding, or two double-quotes " surrounding, the System Variable name.  [I assume you also got those corrected, but just for the sake of anyone else looking around....]

 

(if (= userdimscale 15.0) (setvar 'dimscale 6.0))

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost