JerryFiedler Posted July 11, 2020 Share Posted July 11, 2020 Greetings, I want to toggle the file tab state with a command macro. I cannot use the boole function since "FILETABSTATE" is read-only. I have tried several different formats all similar to the following but none of them worked. The latest non-working code is : ^C^C(if (getvar "FILETABSTATE")(command "FILETABCLOSE") (command "FILETAB")) Whatever I try either returns nil or bad function "filetabclose". Seems simple but I am at a loss. Thanks for reading my post. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted July 11, 2020 Share Posted July 11, 2020 Maybe this simple correction, but haven't tested... ^C^C(if (= 1 (getvar "FILETABSTATE")) (command "FILETABCLOSE") (command "FILETAB")) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 11, 2020 Share Posted July 11, 2020 You can use the following: $M=$(if,$(getvar,filetabstate),_.filetabclose,_.filetab) Quote Link to comment Share on other sites More sharing options...
JerryFiedler Posted July 11, 2020 Author Share Posted July 11, 2020 I have the tabs hidden so FILETABSTATE = 0. The "if" statement is working because I now get the error: bad function "filetab". Prior to change the error referred to "filetabclose". Thank you for your idea. Quote Link to comment Share on other sites More sharing options...
JerryFiedler Posted July 11, 2020 Author Share Posted July 11, 2020 11 minutes ago, Lee Mac said: You can use the following: $M=$(if,$(getvar,filetabstate),_.filetabclose,_.filetab) Lee, that works! Thank you. I have no knowledge of diesel but it looks like I better crack a book. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 11, 2020 Share Posted July 11, 2020 Just now, JerryFiedler said: Lee, that works! Thank you. I have no knowledge of diesel but it looks like I better crack a book. You're most welcome! Quote Link to comment Share on other sites More sharing options...
tombu Posted July 13, 2020 Share Posted July 13, 2020 (edited) If you add $(if,$(and,1,$(getvar,filetabstate)),!.)FileTabState as the Display Name it will display highlighted when toggled on. Not really needed as you can see if they're turned on or not. Helpful when toggling other variables though. DIESEL has always been a big part of Ribbon and Menu customization and pretty easy to learn as the commands are pretty similar to lisp and there's not that many of them. From version 2017 on there's a right click option on tabs to "Activate Model Tab" or "Activate Previous Layout" and the Model tab is always visible but Ctrl+T is still much quicker. Don't remember what version it was introduced but I've been using one of the 'Ribbon Control Elements' 'Ribbon Toggle Button - File Tab'. It automatically displays highlighted when toggled on. It's also in the Interface panel of the View tab. To save screen space I've always kept it toggled off. I use the 'Ribbon Control Elements' 'Ribbon Menu Button - Switch Windows' added to my 'Quick Access Toolbar' to switch drawings or hover over the AutoCAD icon and select one. Ctrl+Home access the AutoCAD Home if you need it. Edited July 13, 2020 by tombu Added another Tip 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.