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

Convert keyword to real

2 REPLIES 2
Reply
Message 1 of 3
katgboykin
185 Views, 2 Replies

Convert keyword to real

I am new! I have researched-can't seem to put it all together. I want to place text on the screen (i.e. Trees) restrict user input to known factors (i.e. 20 40 100) take input multiply that by .06. My code works, but I need to add restrictions..can u help?
2 REPLIES 2
Message 2 of 3
_Tharwat
in reply to: katgboykin

(initget "20 40 100")
(setq st (getkword  "\n Specify number [20 40 100] :"))

 Read about the function initget and getkword .

 

Tharwat

Message 3 of 3
Kent1Cooper
in reply to: katgboykin


@katgboykin wrote:
I am new! I have researched-can't seem to put it all together. I want to place text on the screen (i.e. Trees) restrict user input to known factors (i.e. 20 40 100) take input multiply that by .06. My code works, but I need to add restrictions..can u help?

What _Tharwat said, and then for your mathematical calculation, you need to turn the resulting string into a number:

 

(* (atoi st) 0.06)

 

or (atof) would work, too.

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost