See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Control of non-system variable settings

  1. #1
    Active Member
    Join Date
    2008-09
    Posts
    94
    Login to Give a bone
    0

    Default Control of non-system variable settings

    Is there a way to automate control (by lisp or otherwise) of non-System Variable settings?

    Specifically, I'd like to uncheck the default "Turn off layers not found in layer state" option in the Layer States Manager (LMAN) on new deploys. I'd like to add it to the startup or to a general "setup" lisp command when I'm setting up a new machine. Since it's a set it once and ACAD will remember it - the startup route would be overkill. Using the System Variable dialog (express tool), I was unable to determine a system variable associated with that setting.

    At this point the only way I can turn it off is to manually uncheck it after running the LMAN command. Any suggestions?

  2. #2
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Control of non-system variable settings

    I would assume it is stored with the template. So set it there and it should be good to go if you are using a shared template. Something you can do that provides more data than the express tool is the SETVAR command. It will give you every variable, even the ones not provided by the express tool.

  3. #3
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    2

    Default Re: Control of non-system variable settings

    The setting you are looking for is stored in the registry, here:

    HKEY_CURRENT_USER\SOFTWARE\Autodesk\AutoCAD\Rxx.x\xxxx-xxxx:xxx\Profiles\[Profile_Name]\Dialogs\AcLayerApps:LayerStatesManager

    It's a 32-bit DWORD named "LayerNotFound".
    1 = checked
    0 = not checked

    You can read / write this setting using lisp, like this:

    Code:
    (vl-registry-read
         (strcat "HKEY_CURRENT_USER\\" (vlax-machine-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager")
         "LayerNotFound"
    )
    
    (vl-registry-write
         (strcat "HKEY_CURRENT_USER\\" (vlax-machine-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager")
         "LayerNotFound" 0
    )
    Last edited by rkmcswain; 2017-04-13 at 01:13 PM. Reason: Added lisp code
    R.K. McSwain | CAD Panacea |

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Control of non-system variable settings

    Quote Originally Posted by rkmcswain View Post
    The setting you are looking for is stored in the registry, here:

    HKEY_CURRENT_USER\SOFTWARE\Autodesk\AutoCAD\Rxx.x\xxxx-xxxxxx\Profiles\[Profile_Name]\Dialogs\AcLayerApps:LayerStatesManager

    It's a 32-bit DWORD named "LayerNotFound".
    1 = checked
    0 = not checked

    You can read / write this setting using lisp, like this:

    Code:
    (vl-registry-read
         (strcat "HKEY_CURRENT_USER\\" (vlax-machine-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager")
         "LayerNotFound"
    )
    
    (vl-registry-write
         (strcat "HKEY_CURRENT_USER\\" (vlax-machine-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager")
         "LayerNotFound" 0
    )
    I added the bottom vl-registry-write part to my Acaddoc.lsp file years ago. I use Layer States all the time and all of them only modify groups of layers. Allows me to apply Layer States from the ribbon drop-down.

  5. #5
    Active Member
    Join Date
    2008-09
    Posts
    94
    Login to Give a bone
    0

    Default Re: Control of non-system variable settings

    Quote Originally Posted by rkmcswain View Post
    The setting you are looking for is stored in the registry, here:

    HKEY_CURRENT_USER\SOFTWARE\Autodesk\AutoCAD\Rxx.x\xxxx-xxxxxx\Profiles\[Profile_Name]\Dialogs\AcLayerApps:LayerStatesManager

    It's a 32-bit DWORD named "LayerNotFound".
    1 = checked
    0 = not checked

    You can read / write this setting using lisp, like this:

    Code:
    (vl-registry-read
         (strcat "HKEY_CURRENT_USER\\" (vlax-machine-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager")
         "LayerNotFound"
    )
    
    (vl-registry-write
         (strcat "HKEY_CURRENT_USER\\" (vlax-machine-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager")
         "LayerNotFound" 0
    )
    Fantastic! This works perfectly. Thanks rkmcswain.

    Follow up question. Is there a resource that lists other settings that are stored in the registry like this? I've only ever known of System Variables and I believed the other non-System Variable settings to be untouchable (except manually).

  6. #6
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: Control of non-system variable settings

    No list that I am aware of.
    I just used Process Monitor to watch registry activity while I was changing the setting.
    R.K. McSwain | CAD Panacea |

  7. #7
    Member
    Join Date
    2020-02
    Posts
    6
    Login to Give a bone
    0

    Default Re: Control of non-system variable settings

    Superb. Thanks rkmcswain, exactly what I was looking for. Have incorporated this into a script to load and refresh my company-standard layers

Similar Threads

  1. System Variable to Control Wipe Out Frames
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2012-07-20, 04:26 AM
  2. Compare System Variable Settings
    By kerbocad in forum AutoCAD Tips & Tricks
    Replies: 12
    Last Post: 2009-04-16, 09:20 AM
  3. IMAGEFRAME System Variable
    By joeswantek in forum AutoCAD General
    Replies: 5
    Last Post: 2007-06-21, 05:11 PM
  4. Mtextfixed variable and migrated settings
    By Mamma Jamma in forum AutoCAD Tips & Tricks
    Replies: 0
    Last Post: 2006-11-01, 01:15 PM
  5. System Variable to control text stacking or not stacking
    By jhohman in forum AutoCAD General
    Replies: 5
    Last Post: 2006-09-21, 09:36 PM

Posting Permissions

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