Jump to content

 
Photo

Illustrator automatically apply styles to layers

- - - - -

  • Please log in to reply
12 replies to this topic

#1
Paul McMahon

Paul McMahon

    Newbie

  • Validated Member
  • Pip
  • 6 posts
  • Gender:Male
  • Location:Dublin,Ireland
  • Interests:Cartography,graphics
  • Ireland

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?


#2
David Medeiros

David Medeiros

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,089 posts
  • Gender:Male
  • Location:Redwood City CA
  • Interests:Cartography, wood working, wooden boats, fishing, camping, overland travel, exploring.
  • United States

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.

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

GIS Reference and Instruction Specialist, Stanford Geospatial Center.

 

www.mapbliss.com

 


#3
cartdeco

cartdeco

    Contributor

  • Validated Member
  • PipPip
  • 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.

Hope this helps.

Craig
Craig Molyneux
Spatial Vision
www.spatialvision.com.au
www.svmaps.com.au
craig.molyneux@spatialvision.com.au

#4
Paul McMahon

Paul McMahon

    Newbie

  • Validated Member
  • Pip
  • 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.

Many thanks again
Paul

#5
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,310 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

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:

Attached File  Clipboard01.png   10.21KB   38 downloads
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#6
David Medeiros

David Medeiros

    Hall of Fame

  • Validated Member
  • PipPipPipPipPipPipPip
  • 1,089 posts
  • Gender:Male
  • Location:Redwood City CA
  • Interests:Cartography, wood working, wooden boats, fishing, camping, overland travel, exploring.
  • United States

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:

Attached File  Clipboard01.png   10.21KB   38 downloads


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?

GIS Reference and Instruction Specialist, Stanford Geospatial Center.

 

www.mapbliss.com

 


#7
Andrew Patterson

Andrew Patterson

    Key Contributor

  • Validated Member
  • PipPipPip
  • 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!).
Andrew Patterson
Lead Software Architect
Avenza Systems Inc.

email: andrew@avenza.com
phone: 416.487.5116

#8
Paul McMahon

Paul McMahon

    Newbie

  • Validated Member
  • Pip
  • 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.

#9
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 740 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 roads
Attached File  road_casing.jpg   610.55KB   36 downloads
Left 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

#10
Garvan

Garvan

    Contributor

  • Validated Member
  • PipPip
  • 12 posts
  • Location:Toronto
  • Canada

Rudy, I get different results. The road casings do not intersect for me when I do a layer style.

Attached File  road_casing.png   24.34KB   55 downloads
Garvan Keeley
Software Development Manager
Avenza Systems Inc.

#11
rudy

rudy

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 740 posts
  • Gender:Male
  • Location:Canada
  • Canada

Rudy, I get different results. The road casings do not intersect for me when I do a layer style.

Attached File  road_casing.png   24.34KB   55 downloads

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.

#12
Garvan

Garvan

    Contributor

  • Validated Member
  • PipPip
  • 12 posts
  • Location:Toronto
  • Canada

Thanks, I see what you are saying.
I'll have to add a feature request for a 'Road Casing' tool, if we can find some time for Andrew, I am sure he could come up with something.
Garvan Keeley
Software Development Manager
Avenza Systems Inc.

#13
natcase

natcase

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 572 posts
  • Gender:Male
  • Location:Minneapolis, Minnesota
  • Interests:cartography
    aeshetics
    cartographic design
    John Bartholomew
    road maps
    large-scale mapping
  • United States

Re overlapping casings:
You can also do this by using subfolders:

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.

Nat Case
INCase, LLC

Minneapolis, Minnesota USA
maphead.blogspot.com






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->