Jump to content

 
Photo

Management of the Layers in Illustrator

- - - - -

  • Please log in to reply
6 replies to this topic

#1
kadar_oliver

kadar_oliver

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Cluj-Napoca
  • Interests:I'm cartographer at Schubert & Franzke (Romania) cartographic company.
  • Romania

Hello,

I made a big layer structure in Illustrator, without sublayers just layers. Ex:
-Waters-
---Rivers
---Lakes
---Watercourses
-Buildings-
---Industrial buildings
---Public buildings
---Other buildings
and...
My problem is: It exist a plug-in or script to export some of the layers name (without graphic contains) (ex. Waters) to an external file (ex. notepad, excel,...). And when I need it to import again in Illustrator Layers Window.

Thanks,

KADAR OLIVER

#2
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,882 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I made a big layer structure in Illustrator, without sublayers just layers. Ex:
-Waters-
---Rivers
---Lakes
---Watercourses
-Buildings-
---Industrial buildings
---Public buildings
---Other buildings
and...
My problem is: It exist a plug-in or script to export some of the layers name (without graphic contains) (ex. Waters) to an external file (ex. notepad, excel,...). And when I need it to import again in Illustrator Layers Window.


Not as far as I know, but it doesn't sound like it's a very difficult thing to do. Unfortunately I have no Illustrator scripting experience.

The second part of your question can be solved by making a template document with that layer structure. Alternatively, if you make an Illustrator document with that layer structure and just one object per (sub) layer, you can copy those objects into a new or existing Illustrator document. If the option "Paste Remembers Layers" is on, the correct layer structure will be created, after which you can delete your helper objects.

Hope this helps.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#3
mika

mika

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 120 posts
  • Gender:Male
  • Location:Warsaw
  • Poland

I am not pretty sure how it looks like in illy, as I prefer CorelDRAW, but it shouldn't be that difficult to write a short script that does what you want. You can always record a macro (start recording then perform a few tasks you want to record, stop it and view the generated code). I have never used VBA in illy but I believe it’s supported.

Below is a short code that performs what you want in CorelDRAW, but it must be quite similar to what you’ll have to write for Illustrator.

This function checks if a layer of given name exists in the document and returns true if it does. Otherwise it returns false. You should perform this check so the VBA engine doesn’t raise an error when you try to create a layer that’s already there.
Private Function LayerExists(layername As String)



LayerExists = False



Dim lay As Layer



For Each lay In ActivePage.Layers

If lay.Name = layername Then

LayerExists = True

Exit For

End If

Next



End Function
And the subroutine below simply creates a layer of given name, but only if a layer doesn’t exist in the document
Sub CreateLayer()



'set reference to active document

Dim doc As Document

Set doc = ActiveDocument





'if symbol layer doesn't exist then create it



If Not LayerExists("HereGoesTheLayerName") = True Then

doc.ActivePage.CreateLayer ("HereGoesTheLayerName ")



End If
I know that’s not exactly what you are looking for, though it might give you an idea of what to start with :-)

Dom
maps made easy - www.cartomatic.pl

#4
CHART

CHART

    Chart

  • Validated Member
  • PipPipPipPipPip
  • 358 posts
  • No Country Selected

Here is a javascript snippet that might help,

This script will only LIST the VISIBLE top layers...

if (document.length > 0) {
var doc = activeDocument;
var list = "Visible Layers:\n";
for (var i=0; i<doc.layers.length; i++) {
if (doc.layers[i].visible) {
list += doc.layer[i].name + "\n";
}
}
alert (list);
}


If you want to write out the list to a .txt file you need to open a file for writing ect...
To be honest I don't know how to do that of hand... but it should pretty simple for someone that can handle javascript better then me.
Chart

#5
KennyRedman

KennyRedman

    Contributor

  • Validated Member
  • PipPip
  • 27 posts
  • United States

The second part of your question can be solved by making a template document with that layer structure. Alternatively, if you make an Illustrator document with that layer structure and just one object per (sub) layer, you can copy those objects into a new or existing Illustrator document. If the option "Paste Remembers Layers" is on, the correct layer structure will be created, after which you can delete your helper objects.


I'd say this is the way to go.

#6
kadar_oliver

kadar_oliver

    Newbie

  • Validated Member
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Cluj-Napoca
  • Interests:I'm cartographer at Schubert &amp; Franzke (Romania) cartographic company.
  • Romania

Tanks for the ideas, I was thinking about this method (whit template .ai file) to.
I will use this method. But I still ask you, if you find something please write to the forum.

Tanks again
OLIVER KADAR

#7
James Hines

James Hines

    James Anthony Hines

  • Validated Member
  • PipPipPipPipPipPip
  • 543 posts
  • Gender:Male
  • Location:Centreville, Nova Scotia
  • Interests:Cartography, Philosophy, Politics, Psychology, Economics, Occultism, Spiritualism
  • Canada

-Waters-
---Rivers
---Lakes
---Watercourses
-Buildings-
---Industrial buildings
---Public buildings
---Other buildings


Hey wait isn't the order of the data supposed to be text, point, line, & area? If you layered the information in the fashion suggested then the order should be buildings first, lakes, rivers, & watercourses, (I'm guessing that water courses are streams in this case although improperly labelled).

"There is much beauty that we fail to see through our own eyes teeming with life forms that give us that perception of our reality.  Leaves on the trees blowing gently in the wind, or scarily, the waves pounding through high surf, or lightly on a warm summer’s day; that opportunity to sit or swim in the water on a white beach.   That comfort to shout, “The universal conscious do you hear me?  I am alive, guide me dear logos towards the path of rightnesses.”  Earned what has been kept, no longer to be absorbed into a life filled with cold damn winds and  that stubborn fog clouding  my vision with nothing but darkness."





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->