Results 1 to 5 of 5

Thread: Toggle Sysvars Easily

  1. #1
    100 Club r.grandmaison's Avatar
    Join Date
    2003-11
    Location
    location location
    Posts
    192

    Default Toggle Sysvars Easily

    This might be better in the Customization Lisp forum, but it's such a small, but important little tip that I thought I'd post it here.

    If you don't use ACAD.LSP (or variants) you should! We use it to provide quick toggles between sysvars that have either a 1 or a 0 value. Tilemode, Pickstyle, etc...those kind. You KNOW what the current value is, you just want to quickly jump to the opposite value, and then back again when needed.

    So, copy/paste this bit of code into your ACAD.LSP file and tweak it as needed for your own favorite toggling sysvar:

    Code:
    (defun C:PK ()
      (if (= (getvar "Pickstyle") 1)
    	(setvar "Pickstyle" 0) ; if pickstyle is 1 set it to 0
    	(setvar "Pickstyle" 1) ; otherwise it is 0 so set it to 1
      )
    )
    [ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]
    Last edited by Mike.Perry; 2006-05-08 at 08:33 PM. Reason: [CODE] tags added.

  2. #2
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Houston
    Posts
    7,519

    Default Re: Toggle Sysvars Easily

    That could be shortened to:

    Code:
    (setvar "pickstyle" (abs (1- (getvar "pickstyle"))))

  3. #3
    100 Club r.grandmaison's Avatar
    Join Date
    2003-11
    Location
    location location
    Posts
    192

    Default Re: Toggle Sysvars Easily

    Quote Originally Posted by rkmcswain
    That could be shortened to:

    Code:
     (setvar "pickstyle" (abs (1- (getvar "pickstyle"))))
    Oh, you're good! I like consice code. I'm not a guru at Lisp, just know enough to make things work better around here.

  4. #4
    I could stop if I wanted to de-co1's Avatar
    Join Date
    2005-07
    Location
    Jhb - ZA
    Posts
    260

    Default Re: Toggle Sysvars Easily

    I wish someone would create a bit of code so that I could change our LT to full ACAD!!!

    David


    "Artists to my mind are the real architects of change, and not the political legislators who implement change after the fact."

    William S Burroughs

  5. #5
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Houston
    Posts
    7,519

    Default Re: Toggle Sysvars Easily

    Quote Originally Posted by de-co1
    I wish someone would create a bit of code so that I could change our LT to full ACAD!!!
    Depending on what features you are looking to add, this [ http://www.drcauto.com/ ] may help.

Similar Threads

  1. never done it like this and i'm easily confused....
    By ntnik in forum Revit Architecture - General
    Replies: 17
    Last Post: 2009-08-01, 06:07 AM
  2. Easily hide grids
    By schrodingerscat in forum Revit MEP - General
    Replies: 4
    Last Post: 2008-09-30, 04:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •