Reading registry...for a menu

Discussion in 'AutoCAD' started by 360masterbike, Nov 29, 2004.

  1. Is there a way I can show in my menu if a registry as been modify???

    I’m using AutoLay.lsp. The lisp load each time I open a drawing… For some reason, I have to turn it off sometime. I want to get access to this via my menu…

    ----------------------------------------------------------------------------------------------
    This is the beginning of the lisp:

    ;;;initianize vla- objects as global variables and checks to see if AutoLay is enabled
    (vl-load-com);load VLISP extensions
    (setq acad (vlax-get-acad-object)
    doc (vla-get-ActiveDocument acad)
    layers (vla-get-Layers doc)
    ltypes (vla-get-linetypes doc)
    autolay (vl-registry-read "HKEY_CURRENT_USER\\SOFTWARE\\AutoLay" "Enabled")
    );end setq

    (defun c:autolay ();toggles autolay on and off
    (if autolay
    (vl-registry-delete "HKEY_CURRENT_USER\\SOFTWARE\\AutoLay")
    (vl-registry-write "HKEY_CURRENT_USER\\SOFTWARE\\AutoLay" "Enabled" "T")
    )
    (if (setq autolay (vl-registry-read "HKEY_CURRENT_USER\\SOFTWARE\\AutoLay" "Enabled"))
    (princ "enabled.")
    (princ "disabled.")
    )
    (princ)
    )


    This is my menu:

    [$(if,$(eq,$(vl-registry-read "HKEY_CURRENT_USER\\SOFTWARE\\ autolay " "Enabled"),Enabled),!.)Automatic Layers Enabled ] ^C^C^autolay;

    So if there is a “tickâ€, the Automatic Layer is Enabled…. If I selection this item in my menu… it become Disabled because I run the lisp again.

    Thanks in advance….I’m sure this is feasible!

    Simon
     
    360masterbike, Nov 29, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.