Posted 31 August 2010 - 02:37 PM

I use Adobe Illustrator Cs3&Cs4 and I need to automatically apply styles to layers.

I work with maps which invariably have around 30/40 layers.I import Autocad .dxf/.dwg files intoIllustrator and then manually apply styles from the Graphic Styles which I have created.

My query is this: Is there an way that I can apply a script or an action or some other way that will automatically apply a style to each layer? And how do I do it?

I accidentally did this just the other day. By using the "Target" button on the layers pallet I believe you can assign a style to the layer as opposed to just the art in that layer. Following that, any compatible art moved or copied to that layer will be restyled.

cartdeco

Posted 31 August 2010 - 05:51 PM

cartdeco

Contributor

Validated Member

38 posts

Gender:Male

Location:Melbourne, Victoria, Australia

Australia

I accidentally did this just the other day. By using the "Target" button on the layers pallet I believe you can assign a style to the layer as opposed to just the art in that layer. Following that, any compatible art moved or copied to that layer will be restyled.

But lets see what the real Illy gurus have to say.

You're quite right David. By selecting the target button on the layers palette (that is the button to the right of the layer name), everything on the layer is selected. This is often a quick way to "Select All" on a layer, but it does have one difference. If you apply a graphic style to the selected features it will also apply this style to any new features added to the layer. When you apply the graphic style to the layer the target dot now appears as a gradient. To disable, click and drag the target to the trash can at the bottom of the layers palette.

I often use this feature when I want to create arrows. In this way you don't have to stylise every arrow you draw, just draw a line and the arrowhead appears. In that way you keep your artwork consistent as well.

Paul McMahon

Posted 01 September 2010 - 02:36 AM

Paul McMahon

Newbie

Validated Member

6 posts

Gender:Male

Location:Dublin,Ireland

Interests:Cartography,graphics

Ireland

Thanks David.That does work.
There`s a bit of work in the setup but it does the trick.

I created a blank template replicating all the layers that I was importing from the .dxf file.
I applied a graphic style to each layer by highlighting the target button as suggested.
I saved the file. I then opened the dxf file in Illustrator and selected all the layers content and then
pasted the layers into the prepared template and bingo! I saved the file with a new name to preserve
the integrity of the new template.
It is important to note here that the Paste Remembers Layers option is activated.

frax

Posted 01 September 2010 - 03:07 AM

One thing to keep in mind there though, is that sometimes you want the style to be applied to each individual item, and not a group. This makes a difference for some effects... I am not sure I can think up a good example, but it matters mostly when features overlap. If you have e.g. the drop shadow effect applied to a group, it sees all the individual features/paths as one, so the overlap won't be visible.

Sorry if the above explanation was not that clear... See attached image, that explains it more clearly:

Posted 01 September 2010 - 10:23 AM

One thing to keep in mind there though, is that sometimes you want the style to be applied to each individual item, and not a group. This makes a difference for some effects... I am not sure I can think up a good example, but it matters mostly when features overlap. If you have e.g. the drop shadow effect applied to a group, it sees all the individual features/paths as one, so the overlap won't be visible.

Sorry if the above explanation was not that clear... See attached image, that explains it more clearly:

I haven't played with this much but I'm wondering if you are saying the layer styles treats everything on the layer as a group or are you just talking about objects that are actually grouped before being styled?

Andrew Patterson

Posted 01 September 2010 - 11:43 AM

Andrew Patterson

Key Contributor

Validated Member

99 posts

Gender:Male

Location:Toronto, ON

Canada

I haven't played with this much but I'm wondering if you are saying the layer styles treats everything on the layer as a group or are you just talking about objects that are actually grouped before being styled?

Since layers are actually groups under the hood, I believe for the purposes of styles applied to layers that it treats all objects like they're in one big group (which they are, actually ).

This can be quite useful for things like applying line case styles, since when its applied to a layer it will actually properly handle intersections of cased lines (or whatever the term is -- I'm not a cartographer!).

Paul McMahon

Posted 02 September 2010 - 03:18 AM

Paul McMahon

Newbie

Validated Member

6 posts

Gender:Male

Location:Dublin,Ireland

Interests:Cartography,graphics

Ireland

Up to now I`ve been selecting road geometry and applying a graphic style; then making all a compound path to handle the intersections. This has been okay up to now but I think the method of applying the style to the layer is much better. I`ve just tried it and it works perfectly and is exactly the control I was loooking for when working with many layers of information.

rudy

Posted 02 September 2010 - 05:04 AM

rudy

Ultimate Contributor

Validated Member

757 posts

Gender:Male

Location:Canada

Canada

I haven't played with this much but I'm wondering if you are saying the layer styles treats everything on the layer as a group or are you just talking about objects that are actually grouped before being styled?

Since layers are actually groups under the hood, I believe for the purposes of styles applied to layers that it treats all objects like they're in one big group (which they are, actually ).

This can be quite useful for things like applying line case styles, since when its applied to a layer it will actually properly handle intersections of cased lines (or whatever the term is -- I'm not a cartographer!).

Unless, of course, you want all road fills to appear above all road casings and have different classification of roadsroad_casing.jpg610.55KB36 downloadsLeft is with styles applied to layers; right is with styles applied to objects with duplicate layers for road fill placed above the layers for road casing

Yes - that works if the roads are the same style and on the same layer. But we have different road classifications that we put on different layers; as a result, the casings will cross over each over, not merge.

Layer "combine" includes the common fill
sublayer 1 has the red casing
sublayer 2 has the gray casing
The result is a joined casing between the two sublayers.

It does get a bit more confusing when you are trying to combine 3-line and 2-line symbols with intersecting casing...

Also, be warned that raster effects like drop shadow can take an UNBELIEVABLY long time to process when they are applied to a layer containing number of objects across an entire decent-sized map. Way longer than just applying them to each object.It can also make it almost impossible to edit text in that layer. I speak from bitter experience. Of course, you can just create a graphic style for the effect, clear the layer appearance in order to edit it, and then apply it again when you're ready to output.