Jump to content

Command Macro to Toggle FILETABSTATE


JerryFiedler

Recommended Posts

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.

Link to comment
Share on other sites

Maybe this simple correction, but haven't tested...

 

^C^C(if (= 1 (getvar "FILETABSTATE")) (command "FILETABCLOSE") (command "FILETAB"))

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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! :)

Link to comment
Share on other sites

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 by tombu
Added another Tip
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...