Jump to content

Pull down menu check


deano33

Recommended Posts

Hi All

 

Created a drop down menu with a button to turn on/off a custom toolbar & would like to show a check when the toolbar is already loaded. Anyway I have got this far.

 

ID_AGD TOOLBAR [$(if,$(and,$(getvar,......?......),1),!.)Toggle Toolbar]^C^C-toolbar;AGD;;

 

I know you can right click on any toolbar and select the appropriate toolbar but this would be useful to me if at all possible.

 

Any ideas?

Link to comment
Share on other sites

I could be mistaken, but would it be shown in the registry under:

 

HKEY_CURRENT_USER\Software\AutoDesk\AutoCAD\<Release>\<ProductKey>\Profiles\<CurrentProfile>\Toolbars

Link to comment
Share on other sites

Actually this is a better way:

 

;; tb =  Toolbar Name
(defun ToolbarOn (tb / Men obj vis)
 (vl-load-com) ;; Lee Mac  ~  07.02.10
 
 (vlax-for Men (vla-get-MenuGroups
                 (vlax-get-acad-object))
   
   (if (not (vl-catch-all-error-p
              (setq obj (vl-catch-all-apply
                          (function vla-item)
                            (list (vla-get-Toolbars Men) tb)))))

     (setq vis (vla-get-Visible Obj))))

 (eq :vlax-true vis))

Link to comment
Share on other sites

you may want to try:

 

I edited Lee's Lisp to this:

;; tb =  Toolbar Name
(defun ToolbarOn (tb / Men obj vis)
 (vl-load-com) ;; Lee Mac  ~  07.02.10
 
 (vlax-for Men (vla-get-MenuGroups
                 (vlax-get-acad-object))
   
   (if (not (vl-catch-all-error-p
              (setq obj (vl-catch-all-apply
                          (function vla-item)
                            (list (vla-get-Toolbars Men) tb)))))

(setq vis (vla-get-Visible Obj)))

 (if (eq :vlax-true vis) (setvar "USERR1" 1)(setvar "USERR1" 0))))
(toolbaron "AGD")

 

Then appload that lisp in your startup suite, so it will run on every opening of a drawing.

 

 

then in your toolbar macro put this:

 

 

ID_AGD TOOLBAR [$(if,$(and,$(getvar,USERR1),1),!.)Toggle Toolbar]^C^C-toolbar;AGD;;_setvar;USERR1;$M=$(-,1,$(getvar,USERR1))

 

 

I did not test this but hope you get the idea.

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