Jump to content

Recommended Posts

Posted

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

  • Replies 49
  • Created
  • Last Reply

Top Posters In This Topic

  • Kerry Brown

    27

  • Tharwat

    22

  • Lee Mac

    1

Top Posters In This Topic

Posted Images

Posted

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 )

Posted

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,

Posted

what is this testing ??

(= sty Closed)

 

 

And what TYPE does the (setvar "cmlstyle" xxx ) accept ??

Posted

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"

Posted

.. and back to my earlier question :

 

And what is the result of this ??

( TYPE sty )

Posted

and again ..

 

what is this testing ??

(= sty Closed)

 

 

And what TYPE does the
(setvar "cmlstyle" xxx )
accept ??

Posted

It's saying

 

If the Variable sty

is EQUAL to the variable Closed

return T

else return nil

 

 

SO

 

 

what will (= sty Closed) return

Posted

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,

Posted
what is this testing ??

(= sty Closed)

 

it isn't NIL :

 
(= str closed)
T

Posted

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")

Posted
it isn't NIL :

 
(= str closed)
T

 

that's Wrong !

 

[added]

unless you have assigned a value to the variable Closed ...

Posted
ow ... No both are NIL .:oops:

 

:)

 

OK, you tested str, not sty

 

Try

(= sty Closed)

Posted
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. :)

Posted

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

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