Tharwat Posted August 4, 2010 Posted August 4, 2010 Any idea to set a specific MLine Style on when codes are running . Of course I have created the Mline Styles for Closed, Opened in the drawing. (initget 1 "Closed Opened ") (setq sty (getkword "\nSpecify the MLineSty [Closed Opened ]:")) (cond ((= sty Closed)(setvar "cmlstyle" "Closed")) ((= sty Opened)(setvar "cmlstyle" "Opened")) ) Thanks Tharwat Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 What is the value of variable STY when you run this: :- (initget 1 "Closed Opened ") (setq sty (getkword "\nSpecify the MLineSty [Closed Opened ]:")) And what is the tresult of this ?? ( TYPE sty ) Quote
Tharwat Posted August 4, 2010 Author Posted August 4, 2010 It would get the string of the answer. for example ; Command: (initget 1 "Closed Opened ") Command: (setq sty (getkword "\nSpecify the MLineSty [Closed Opened ]:")) Specify the MLineSty [Closed Opened ]:c "Closed" Command: !sty "Closed" Regards, Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 what is this testing ?? (= sty Closed) And what TYPE does the (setvar "cmlstyle" xxx ) accept ?? Quote
Tharwat Posted August 4, 2010 Author Posted August 4, 2010 If you try it with the following in your new drawing, you will get "STANDARD" . Which is the current MLStyle (Multiline Style). command line : (getvar "cmlstyle")"STANDARD" Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 .. and back to my earlier question : And what is the result of this ?? ( TYPE sty ) Quote
Tharwat Posted August 4, 2010 Author Posted August 4, 2010 Here it is .... Command: (type sty) STR Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 and again .. what is this testing ?? (= sty Closed) And what TYPE does the (setvar "cmlstyle" xxx ) accept ?? Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 It's saying If the Variable sty is EQUAL to the variable Closed return T else return nil SO what will (= sty Closed) return Quote
Tharwat Posted August 4, 2010 Author Posted August 4, 2010 I do appreciate your direct answer to my question to get them worked. Really I wonder why is that !!!!.. So what is your suggestions in this case ? regards, Quote
Tharwat Posted August 4, 2010 Author Posted August 4, 2010 what is this testing ??(= sty Closed) it isn't NIL : (= str closed) T Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 I'm not prepared to answer your question ... I'd rather YOU answer it .. That way you remember HOW to resolve the problem. with (setq sty "Closed") How are these different ?? (= sty Closed) (= sty "Closed") Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 it isn't NIL : (= str closed) T that's Wrong ! [added] unless you have assigned a value to the variable Closed ... Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 ow ... No both are NIL . OK, you tested str, not sty Try (= sty Closed) Quote
Kerry Brown Posted August 4, 2010 Posted August 4, 2010 It's saying If the Variable sty is EQUAL to the variable Closed return T else return nil added: This is why most programmers talk to themselves ... saying this out loud helps to undersrand the problem. Quote
Tharwat Posted August 4, 2010 Author Posted August 4, 2010 You are amazing. Always hurry gets blind eyes. And how crazy is that my variable would give T to continue since that it would return NIL ???? So I should look for another way to get it work well ... And I may back to you .... Agree ? Regards, Tharwat Quote
Recommended Posts
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.