Author Topic: Floating Toolbar Locations  (Read 3319 times)

0 Members and 1 Guest are viewing this topic.

Dave M

  • Newt
  • Posts: 196
Floating Toolbar Locations
« on: April 02, 2018, 12:20:54 PM »
I created a workspace for myself with a few floating toolbars.  If I switch to another workspace and then switch back my toolbars are not where I placed them.


Does anyone have, or know of, a routine that would save the positions of the floating toolbars so I can place them back where I want them easily?


Thanks for any possible help
Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Floating Toolbar Locations
« Reply #1 on: April 02, 2018, 01:00:41 PM »
There is a setting which controls auto-saving your workspace.  When this is off, you need to manually save any changes you make e.g. moved/hidden/shown toolbars.  When it's on any changes are saved as you make them; however, this counts *any* changes including some situations where you don't want it saved e.g. a partially loaded CUIx cannot be found when starting the program, or temporarily hiding something because you don't need it right now.

I usually recommend keeping the setting as off, and deliberately saving changes rather than letting the program decide "Hey that's new so we'll keep going with that...".

Check out the WSAUTOSAVE system variable and the WSSAVE command.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Floating Toolbar Locations
« Reply #2 on: April 02, 2018, 01:03:33 PM »
Agree with dgorsman, but the following is a quick function to obtain the positions of all floating toolbars for a given menugroup:

Code - Auto/Visual Lisp: [Select]
  1. (defun floatingtoolbarpositions ( mgp / mnu rtn )
  2.     (if
  3.         (not
  4.             (vl-catch-all-error-p
  5.                 (setq mnu
  6.                     (vl-catch-all-apply 'vla-item
  7.                         (list (vla-get-menugroups (vlax-get-acad-object)) mgp)
  8.                     )
  9.                 )
  10.             )
  11.         )
  12.             (function
  13.                 (lambda ( tbr )
  14.                     (if (and (= :vlax-true (vla-get-visible tbr)) (= actoolbarfloating (vla-get-dockstatus tbr)))
  15.                         (setq rtn
  16.                             (cons
  17.                                 (list
  18.                                     (vla-get-name tbr)
  19.                                     (vla-get-top  tbr)
  20.                                     (vla-get-left tbr)
  21.                                 )
  22.                                 rtn
  23.                             )
  24.                         )
  25.                     )
  26.                 )
  27.             )
  28.         )
  29.     )
  30.     (reverse rtn)
  31. )

e.g.:
Code - Auto/Visual Lisp: [Select]
  1. (floatingtoolbarpositions "ACAD")

Dave M

  • Newt
  • Posts: 196
Re: Floating Toolbar Locations
« Reply #3 on: April 02, 2018, 02:04:30 PM »
dgorsman - I always keep the WSAUTOSAVE setting at zero; thanks for the reply.


Lee - thanks for the code. Works perfect as usual.  Is it normal for the "Y" value to be listed first?


I wish I knew how to code.  I would create something that would let me write the coordinates of the toolbars to a text file that I could import if I wanted at a later date.


I should have mentioned that I am using Civil 3D.  I don't think it matters, but I can't understand why they don't come back to their original positions.


Thanks again.
Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox

GDF

  • Water Moccasin
  • Posts: 2081
Re: Floating Toolbar Locations
« Reply #4 on: April 02, 2018, 03:09:15 PM »
You can always hard code them into a position.
First show them, then position them as in code below:

Code: [Select]
  (command "toolbar" "ALL" "hide")
  (command "toolbar" "acad.TB_STANDARD" "show")
  (command "toolbar" "acad.TB_LAYER" "show")
  (command "toolbar" "arch.arch_program" "show")
  (command "toolbar" "arch.arch_sset" "show")
  (command "toolbar" "arch.arch_toolpalette" "show") 
  (command "toolbar" "acad.TB_STANDARD" "top" "0,0")
  (command "toolbar" "acad.TB_LAYER" "top" "515,0")
  (command "toolbar" "arch.arch_program" "top" "825,0")
  (command "toolbar" "arch.arch_sset" "top" "900,0")
  (command "toolbar" "arch.arch_toolpalette" "top" "950,0")

Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

MSTG007

  • Gator
  • Posts: 2606
  • I can't remeber what I already asked! I need help!
Re: Floating Toolbar Locations
« Reply #5 on: April 02, 2018, 03:23:55 PM »
Thanks for sharing that. I had no idea you could do that.
Civil3D 2020

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: Floating Toolbar Locations
« Reply #6 on: April 03, 2018, 01:22:58 PM »
Agree with dgorsman, but the following is a quick function to obtain the positions of all floating toolbars for a given menugroup:
...
e.g.:
Code - Auto/Visual Lisp: [Select]
  1. (floatingtoolbarpositions "ACAD")
I get nil...  where am I wrong?
Comando: (vla-get-toolbars (vla-Item (vla-get-menugroups (vlax-get-acad-object)) "Acad"))
#<VLA-OBJECT IAcadToolbars 0000000031adbcb8>
Comando: (floatingtoolbarpositions "Acad")
nil

Dlanor

  • Bull Frog
  • Posts: 263
Re: Floating Toolbar Locations
« Reply #7 on: April 03, 2018, 01:43:24 PM »
I get nil...  where am I wrong?
Comando: (vla-get-toolbars (vla-Item (vla-get-menugroups (vlax-get-acad-object)) "Acad"))
#<VLA-OBJECT IAcadToolbars 0000000031adbcb8>
Comando: (floatingtoolbarpositions "Acad")
nil

Does your workspace have any floating toolbars?  :idea:

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Floating Toolbar Locations
« Reply #8 on: April 03, 2018, 02:41:31 PM »
I've created my own config allowing to save toolbars layouts..

Keep smile...

Dave M

  • Newt
  • Posts: 196
Re: Floating Toolbar Locations
« Reply #9 on: April 03, 2018, 03:31:24 PM »
I've created my own config allowing to save toolbars layouts..


That looks like it works nicely!
Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: Floating Toolbar Locations
« Reply #10 on: April 03, 2018, 03:33:51 PM »
I get nil...  where am I wrong?
Comando: (vla-get-toolbars (vla-Item (vla-get-menugroups (vlax-get-acad-object)) "Acad"))
#<VLA-OBJECT IAcadToolbars 0000000031adbcb8>
Comando: (floatingtoolbarpositions "Acad")
nil

Does your workspace have any floating toolbars?  :idea:
You are right! I thought it would give me the position of all the toolbars. I apologize.

Edit:  modified line:   (if (= :vlax-true (vla-get-visible tbr)) ; (= actoolbarfloating (vla-get-dockstatus tbr))

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Floating Toolbar Locations
« Reply #11 on: April 03, 2018, 04:04:12 PM »
I've created my own config allowing to save toolbars layouts..


That looks like it works nicely!

thanks,..I use it every days...with all users costum toolbars...
combined with another tool called MENULOADS wich allows to load and unload multiple menu in one shot..
and detect, edit, and save setting and associated MNL files..

« Last Edit: April 04, 2018, 03:50:41 PM by Andrea »
Keep smile...

Dave M

  • Newt
  • Posts: 196
Re: Floating Toolbar Locations
« Reply #12 on: June 22, 2018, 05:28:46 PM »
Is this something you would be willing to share?

Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox