[Solved] Arrange order of layers

Discuss the drawing application
Post Reply
mpurcell
Posts: 2
Joined: Wed Dec 08, 2021 4:10 am

[Solved] Arrange order of layers

Post by mpurcell »

How does one arrange the order of the layer navigation tabs on the lower part of the drawing interface? I use some layers a lot more than others, and I would like to have the most used ones grouped together. Here's what I am speaking of. Thanks for any ideas or help.
Attachments
Screen Shot 2021-12-07 at 6.13.05 PM.png
Last edited by MrProgrammer on Wed Dec 15, 2021 7:48 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]
Open Office 4.0 macOS Catalina
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Arranging order of layer tabs

Post by Lupp »

There's no direct way via the UI and doing it by user code would be complicated.
You should create the layers in the order you want to evantually see.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
mpurcell
Posts: 2
Joined: Wed Dec 08, 2021 4:10 am

Re: Arranging order of layer tabs

Post by mpurcell »

Thank you. I just tried that and the program keeps dropping the tabs out of creation order in the row.
Open Office 4.0 macOS Catalina
User avatar
MrProgrammer
Moderator
Posts: 4907
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Arranging order of layer tabs

Post by MrProgrammer »

mpurcell wrote:I just tried that and the program keeps dropping the tabs out of creation order in the row.
In my experience, a new layer is created to the right of the layer which is active at the time of Insert → Layer. Thus, you should be able to create a new drawing file with the layers in the order you wish, then copy/paste your drawing objects from your old file to a new one. Hide (Shift+click) all of the layer tabs except one, so only the objects of one layer are visible. You should be able to select all of the items in that layer, then copy/paste them all at once. I tested, individually, all of the previous steps. Creating a new drawing with the layers ordered correctly would be the non-technical way to rearrange layers.
mpurcell wrote:How does one arrange the order of the layer navigation tabs on the lower part of the drawing interface?
The Draw Guide does not offer a method to arrange the order of the layers in an existing file. But there is a way if you want to edit the file with a text editor. First, make a backup of your drawing in case you damage it. For simplicity I will assume that the drawing is on your MacOS Desktop. Then Finder → Go (menu) → Utilities → Terminal.app (double click). Use these commands:
   cd ~/Desktop
   unzip -p "Drawing.odg" styles.xml | tidy -xml -utf8 -i -q -wrap 9999 -o styles.xml
   open -e styles.xml
This opens a file in TextEdit. Near the bottom you should find
    <draw:layer-set>
      <draw:layer draw:name="layout" />
      <draw:layer draw:name="background" />
      <draw:layer draw:name="backgroundobjects" />
      <draw:layer draw:name="controls" />
      <draw:layer draw:name="measurelines" />
      <draw:layer draw:name="Your1stLayer" />
      <draw:layer draw:name="Your2ndLayer" />
      <draw:layer draw:name="Your3rdLayer" />
      …
    </draw:layer-set>
Do not change the first five layers. Edit the styles.xml file to put the remaining layers in the order you want them. File → Save then File → Close. Using Terminal again:
   zip -fm "Drawing.odg" styles.xml
   exit
Terminal → Quit. When I opened my drawing, the layers were in the order I specified in TextEdit. That's ~/Desktop not -/Desktop in the first command. Drawing.odg represents the name of your drawing file. If you need any additional assistance, attach a document demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself).

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Post Reply