Jump to content

LWT toggle


geo

Recommended Posts

(defun c:lwt ()
 (if
   (= (getvar "lwdisplay") 1)
   (setvar "lwdisplay" 0)
   (setvar "lwdisplay" 1)
      )
 )

or you could just click on the LWT button on the status bar

Link to comment
Share on other sites

Thanks lpseifert, i needed this rountine to run as part of another lisp routine.

 

Clicking the LWT button is the easy way to do this but doesnt suit my app.

 

Cheers

Link to comment
Share on other sites

Good point lpseifert - Obviously Carl's code needs an extra right parenthesis, but this aside, why does it not require an (abs)?

 

If you type:

 

(setvar "lwdisplay" -1)

 

in the command line, ACAD rejects the variable setting.

 

So how can this code work without the (abs)? :glare:

Link to comment
Share on other sites

And to save a tiny bit of storage space :)

 

(defun c:lwt ()
  (setvar "lwdisplay" (- 1 (getvar "lwdisplay"))
)

 

 

 

a nice one carlb, you need to put your name there, let's call it carlbtoggler....:)

Link to comment
Share on other sites

Of course.... I read it the same as lpseifert - subtracting 1 from whichever value the variable is set at.

 

But I take my hat off to you (if I had one), a simple and clever bit of coding indeed. :D

Link to comment
Share on other sites

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