deano33 Posted February 7, 2010 Share Posted February 7, 2010 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? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 7, 2010 Share Posted February 7, 2010 I could be mistaken, but would it be shown in the registry under: HKEY_CURRENT_USER\Software\AutoDesk\AutoCAD\<Release>\<ProductKey>\Profiles\<CurrentProfile>\Toolbars Quote Link to comment Share on other sites More sharing options...
deano33 Posted February 7, 2010 Author Share Posted February 7, 2010 Not Sure? A bit above my head really. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 7, 2010 Share Posted February 7, 2010 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)) Quote Link to comment Share on other sites More sharing options...
wizman Posted February 8, 2010 Share Posted February 8, 2010 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 8, 2010 Share Posted February 8, 2010 Nice idea Wiz My only worry is that he is noted to using LT... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.