Subscribe to this thread
Home - General / All posts - Copy style to several drawings
geozap
264 post(s)
#23-Dec-22 05:32

I have several drawings that have the same fields. Frequently new drawings are imported in the project that have also the same fields.

I have 1 of them that has the style I want, that is based on the values of one field. I want all the other drawings have the same style.

In order to do this I am using the mfd_meta Table, as described in the"Example: Style Properties in the mfd_meta Table" in the manual. The problem is that the properties I want to set for a new drawing are not visible in the mfd_meta,until they are manually changed to something other that the default value. So for every drawing I need to manually change a lot of values (around 15 if I count correctly, since areas, lines, and points all need to have not-default styles). That's a lot of boring work, when done all the time for many drawings!

Is there currently a way to do such a thing, copy all style properties at once from a drawing to another?

PS: It would be nice to have a copy style and a paste style button, to copy-paste styles from a drawing to another.

Dimitri


7,411 post(s)
#23-Dec-22 06:26

There are at least three ways of doing that. What I do is copy/paste the drawing that has all the fancy formatting and then in the Properties for the copy change the table it uses.

Suppose you have an elaborately formatted drawing called Cities, which in the Properties has a Table property of [Cities Table], that is, the drawing takes its data from Cities Table. You import new drawings into the project called Cities2, Cities3, and so on, which take their data from Cities2 Table, Cities3 Table, and so on.

Delete the drawing called Cities2. Copy and paste the elaborately formatted Cities drawing (just the drawing, and not the table). Now you have a copy called Cities2 or whatever. Open the properties and change the Table property value to [Cities2 Table]. Done. You can repeat that for all the drawings you want.

The above is what I usually do, because it's a simple Ctrl-C, Ctrl-V, and then editing one value in the Properties to point the resulting drawing at the desired source table. That's fast and hard to mess up, so long as the target components have the same fields as the one with the formatting you want to duplicate.

Another way is to edit the mfd_meta Table. This goes quickly if you have learned good Select pane, Transform pane and table editing skills. If you're new to those, use a copy of the mfd_meta table while learning.

Open the table and select all the Style properties for the Cities drawing. Copy those, and paste them. Select those pasted style records and change the name of the drawing in the selected records to Cities2. Done.

A third way is to use SQL or a script to do the above.

Regarding the PS: I've sent that in as a suggestion, but it seems very few others, if any, think it worth sending in a suggestion to the same effect.

I'm sending in a related suggestion today, suggesting that the Info pane be equipped with a Properties tab for when it's not in "picked" mode, where the grid control allows copying/pasting of multiple properties. Given the non-modal nature of panes that would make it easy to copy properties with the focus on one component, click on another component, and then paste into the properties there.

Bernd Raab63 post(s)
online
#23-Dec-22 08:07

sloots has created a little addin to copy the style from one drawing to another. See his post from 14.2.2022. It works wonderful.

Dimitri


7,411 post(s)
#23-Dec-22 08:27

I forgot about that! You're right, it's perfect.

Here's the link: https://georeference.org/forum/t159226.4#159227

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.