<?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 Is it possible to add a stylex file into an ArcGIS pro Project with Python? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/is-it-possible-to-add-a-stylex-file-into-an-arcgis/m-p/1072477#M61492</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I am creating a script with the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://ssl.microsofttranslator.com/bv.aspx?ref=TAns&amp;amp;from=&amp;amp;to=en&amp;amp;a=arcpy.mp" target="_blank" rel="noopener"&gt;arcpy.mp&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;module that allows you to load or update layers to an .aprx project, the problem is when it comes to importing style sheets in an automated way to the project. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a way to import these style sheets into a Project via Python without having to do so from ArcGIS pro?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd tried to use aprx.importDocument() method but when I link a stylex file, code breaks with OSError&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Code sample and TraceBack:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;aprx.importDocument(r"C:\Styles\Burgos.stylx")&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\_mp.py", line 228, in importDocument&lt;BR /&gt;return convertArcObjectToPythonObject(self._arc_object.importDocument(*gp_fixargs((document_path, include_layout, reuse_existing_maps), True)))&lt;BR /&gt;OSError: C:\Styles\Burgos.stylx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 08:38:16 GMT</pubDate>
    <dc:creator>Nicorocas</dc:creator>
    <dc:date>2021-06-25T08:38:16Z</dc:date>
    <item>
      <title>Is it possible to add a stylex file into an ArcGIS pro Project with Python?</title>
      <link>https://community.esri.com/t5/python-questions/is-it-possible-to-add-a-stylex-file-into-an-arcgis/m-p/1072477#M61492</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am creating a script with the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://ssl.microsofttranslator.com/bv.aspx?ref=TAns&amp;amp;from=&amp;amp;to=en&amp;amp;a=arcpy.mp" target="_blank" rel="noopener"&gt;arcpy.mp&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;module that allows you to load or update layers to an .aprx project, the problem is when it comes to importing style sheets in an automated way to the project. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a way to import these style sheets into a Project via Python without having to do so from ArcGIS pro?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd tried to use aprx.importDocument() method but when I link a stylex file, code breaks with OSError&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Code sample and TraceBack:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;aprx.importDocument(r"C:\Styles\Burgos.stylx")&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\_mp.py", line 228, in importDocument&lt;BR /&gt;return convertArcObjectToPythonObject(self._arc_object.importDocument(*gp_fixargs((document_path, include_layout, reuse_existing_maps), True)))&lt;BR /&gt;OSError: C:\Styles\Burgos.stylx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 08:38:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-it-possible-to-add-a-stylex-file-into-an-arcgis/m-p/1072477#M61492</guid>
      <dc:creator>Nicorocas</dc:creator>
      <dc:date>2021-06-25T08:38:16Z</dc:date>
    </item>
  </channel>
</rss>

