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

PROMPT Help

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
K_R_Venkat
317 Views, 5 Replies

PROMPT Help

Hi all,

I want to know that which expression (THEN expr or ELSE expr) has been evaluated while running IF Function.


Is there any way to prompt that. please help me


Thanks in Advance


Venkat.PR
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: K_R_Venkat

(if (< x y)
(progn
(prompt "\n then ")
(setq x (1+ x)
)
(progn
(prompt "\n else ")
(setq x (1- x)
)
)

rpvrk_pss wrote:
> Hi all, I want to know that which expression (THEN expr or ELSE expr)
> has been evaluated while running IF Function.
> Is there any way to prompt that. please help me
> Thanks in Advance
> Venkat.PR
Message 3 of 6
K_R_Venkat
in reply to: K_R_Venkat

Thanks Gent,

please have a look at this below code. And kindly correct me how to prompt Only once instead of executing with all.

{quote}(while
(setq layline (read-line layfile)); as long as there's still another line in the file
(setq
laynameDutch (substr layline 1 (vl-string-search ";" layline))
laynameEnglish (substr layline (+ (vl-string-search ";" layline) 2))
); end setq
(if (tblsearch "layer" laynameDutch); if the layer exists
(progn
(prompt "\n Layer Name is in ENGLISH")
(setq LR_cont (entget (tblobjname "LAYER" laynameDutch))
LR_cont (subst (cons 2 laynameEnglish) (assoc 2 LR_cont) LR_cont)
)
(entmod LR_cont)
){quote}
Message 4 of 6
scottbolton
in reply to: K_R_Venkat

Does this help?

mvg,

S

(SETQ NAMECHECK T)
(while
(setq layline (read-line layfile)); as long as there's still another line in the file
(setq laynameDutch (substr layline 1 (vl-string-search ";" layline))
laynameEnglish (substr layline (+ (vl-string-search ";" layline) 2))
); end setq
(if (tblsearch "layer" laynameDutch); if the layer exists
(progn
(IF NAMECHECK
(PROGN
(prompt "\n Layer Name is in ENGLISH")
(SETQ NAMECHECK NIL)
)
)
(setq LR_cont (entget (tblobjname "LAYER" laynameDutch))
LR_cont (subst (cons 2 laynameEnglish) (assoc 2 LR_cont) LR_cont)
)
(entmod LR_cont)
)
;;; THESE BRACKETS WERE MISSING ;;
)
)
Message 5 of 6
K_R_Venkat
in reply to: K_R_Venkat

Thanks ScottBolton,

works exactly what i want.

you are the saver.

{quote}
(SETQ NAMECHECK T)
{quote}

Could you explain that how it works please.

Regards
Venkat.PR Edited by: rpvrk_pss on Feb 23, 2010 1:03 PM
Message 6 of 6
scottbolton
in reply to: K_R_Venkat

You're welcome!

S

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

Post to forums  

Autodesk Design & Make Report

”Boost