<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Symbology &amp;amp;amp; changing versions - a total newbie needs help in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/symbology-amp-amp-changing-versions-a-total-newbie/m-p/226896#M17578</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Python beginner here. I know what I want to do, but I don't know what all the parts of code are called, so I'm hoping someone can bear with me and help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working on a script to add layers to a blank mxd, set the symbology of each layer, and convert the mxd to version 9.3 (per project requirements). The geodatabase has to stay in 9.3 also.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A script is already in place that creates the blank mxd (copies a template), a blank geodatabase with 5 polylines, and a couple other shapefiles in the main model folder. I've gotten a script to work using arcpy that pulls in the all those things into the map in the correct order. I've created a template model with all the symbology I want, and have created .lyr files of everything. What I need to do now is get that symbology applied to the folder that I'm inputting (which is Test_Cr right now), save the mxd in version 9.3, and make sure the geodatabase stays in 9.3. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the map I'm starting with is v10_Test_Cr.mxd, the one that will be used is Test_Cr.mxd and v10 will get deleted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I must be missing something, because I'm not getting an error but the symbology is not changed in either Test_Cr or v10_Test_Cr after the script is run. I know I also have a lot of extra lines of junk, mostly because I don't know what everything does and I'm copying from various places .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
import os
import shutil
import sys
import arcgisscripting
from arcpy import env

gp = arcgisscripting.create(9.3)

OutputFolder = gp.GetParameterAsText(0)

gp.workspace = OutputFolder
arcpy.env.workspace = OutputFolder
model_path = OutputFolder

(head,tail) = os.path.split(model_path) # model path split
Reach_Code = tail # just reach code

#symbology locations
Symbology = r"F:\Script\Symbology"
Symbology_mxd = r"F:\Script\Symbology\Symbology.mxd"

mxd = arcpy.mapping.MapDocument(r"F:\Test_Cr\v10_Test_Cr.mxd")

# make geometry feature classes into layers
arcpy.MakeFeatureLayer_management(r"F:\Test_Cr\Test_Cr.mdb\Layers\River_Test_Cr", "Riverlyr")

# Save geometry layers as .lyr files
arcpy.SaveToLayerFile_management("Riverlyr", "Riverlyr.lyr")

#shortcuts for geometry layer files
River_Map = r"F:\Test_Cr\Riverlyr.lyr"

# shortcuts for symbology layer files
River_Symb = r"F:\Script\Symbology\Layers\River_Symbology.lyr"

#apply symbology
arcpy.ApplySymbologyFromLayer_management(River_Map, River_Symb)

mxd.save()
mxd.saveACopy(r"F:\Test_Cr\Test_Cr.mxd", '9.3')
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Dec 2013 17:41:52 GMT</pubDate>
    <dc:creator>AshleyC</dc:creator>
    <dc:date>2013-12-27T17:41:52Z</dc:date>
    <item>
      <title>Symbology &amp;amp; changing versions - a total newbie needs help</title>
      <link>https://community.esri.com/t5/python-questions/symbology-amp-amp-changing-versions-a-total-newbie/m-p/226896#M17578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Python beginner here. I know what I want to do, but I don't know what all the parts of code are called, so I'm hoping someone can bear with me and help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working on a script to add layers to a blank mxd, set the symbology of each layer, and convert the mxd to version 9.3 (per project requirements). The geodatabase has to stay in 9.3 also.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A script is already in place that creates the blank mxd (copies a template), a blank geodatabase with 5 polylines, and a couple other shapefiles in the main model folder. I've gotten a script to work using arcpy that pulls in the all those things into the map in the correct order. I've created a template model with all the symbology I want, and have created .lyr files of everything. What I need to do now is get that symbology applied to the folder that I'm inputting (which is Test_Cr right now), save the mxd in version 9.3, and make sure the geodatabase stays in 9.3. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the map I'm starting with is v10_Test_Cr.mxd, the one that will be used is Test_Cr.mxd and v10 will get deleted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I must be missing something, because I'm not getting an error but the symbology is not changed in either Test_Cr or v10_Test_Cr after the script is run. I know I also have a lot of extra lines of junk, mostly because I don't know what everything does and I'm copying from various places .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
import os
import shutil
import sys
import arcgisscripting
from arcpy import env

gp = arcgisscripting.create(9.3)

OutputFolder = gp.GetParameterAsText(0)

gp.workspace = OutputFolder
arcpy.env.workspace = OutputFolder
model_path = OutputFolder

(head,tail) = os.path.split(model_path) # model path split
Reach_Code = tail # just reach code

#symbology locations
Symbology = r"F:\Script\Symbology"
Symbology_mxd = r"F:\Script\Symbology\Symbology.mxd"

mxd = arcpy.mapping.MapDocument(r"F:\Test_Cr\v10_Test_Cr.mxd")

# make geometry feature classes into layers
arcpy.MakeFeatureLayer_management(r"F:\Test_Cr\Test_Cr.mdb\Layers\River_Test_Cr", "Riverlyr")

# Save geometry layers as .lyr files
arcpy.SaveToLayerFile_management("Riverlyr", "Riverlyr.lyr")

#shortcuts for geometry layer files
River_Map = r"F:\Test_Cr\Riverlyr.lyr"

# shortcuts for symbology layer files
River_Symb = r"F:\Script\Symbology\Layers\River_Symbology.lyr"

#apply symbology
arcpy.ApplySymbologyFromLayer_management(River_Map, River_Symb)

mxd.save()
mxd.saveACopy(r"F:\Test_Cr\Test_Cr.mxd", '9.3')
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2013 17:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/symbology-amp-amp-changing-versions-a-total-newbie/m-p/226896#M17578</guid>
      <dc:creator>AshleyC</dc:creator>
      <dc:date>2013-12-27T17:41:52Z</dc:date>
    </item>
  </channel>
</rss>

