<?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 Re: Does arcpy.mp module work inside a Python toolbox when executing in Visual Studio Code? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/does-arcpy-mp-module-work-inside-a-python-toolbox/m-p/1289909#M69256</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The main issue you'll find is that &lt;FONT face="courier new,courier"&gt;arcpy.mp.ArcGISProject(&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class=""&gt;"CURRENT"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt; won't work outside of ArcGIS Pro.&amp;nbsp; This includes scripts run from an IDE or external python interpreter or script tools/python toolbox tools started from ArcGIS Pro but&amp;nbsp;running in the background.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can use &lt;FONT face="courier new,courier"&gt;arcpy.mp&lt;/FONT&gt; outside of ArcGIS Pro, but to instantiate an &lt;FONT face="courier new,courier"&gt;ArcGISProject&lt;/FONT&gt; object, you need to use&amp;nbsp;&lt;FONT face="courier new,courier"&gt;arcpy.mp.ArcGISProject(r&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class=""&gt;"Drive:\Path\to\project.aprx&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&amp;nbsp;and understand that any changes you make won't be reflected in an open ArcGIS Pro project, but you need to save the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ArcGISProject&lt;/FONT&gt; object and then open it in Pro to see changes.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 01:04:58 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2023-05-17T01:04:58Z</dc:date>
    <item>
      <title>Does arcpy.mp module work inside a Python toolbox when executing in Visual Studio Code?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/does-arcpy-mp-module-work-inside-a-python-toolbox/m-p/1288516#M69104</link>
      <description>&lt;P&gt;I am looking at this documentation for post processing validation&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/post-execution-validation-in-a-pyt.htm" target="_self"&gt;resource&lt;/A&gt;&amp;nbsp;within a python toolbox and it utilizes the arcpy.mp module for manipulating the contents of existing projects (.aprx) and layer files (.lyrx). The example in that link above makes it seem that arcpy.mp&amp;nbsp;&lt;EM&gt;can&amp;nbsp;&lt;/EM&gt;be used inside a python toolbox. However, I'm reading that arcpy.mp requires that some methods and properties only work when ran inside the python pane or a script tool inside of ArcPro (&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_self"&gt;ArcGISProject object resource&lt;/A&gt;&amp;nbsp;). Does the arcpy.mp only work when its a geoprocessing toolbox and not a python toolbox thats executed in an IDE?&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 10:46:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/does-arcpy-mp-module-work-inside-a-python-toolbox/m-p/1288516#M69104</guid>
      <dc:creator>awesomeLLama27</dc:creator>
      <dc:date>2023-05-12T10:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Does arcpy.mp module work inside a Python toolbox when executing in Visual Studio Code?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/does-arcpy-mp-module-work-inside-a-python-toolbox/m-p/1289909#M69256</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The main issue you'll find is that &lt;FONT face="courier new,courier"&gt;arcpy.mp.ArcGISProject(&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class=""&gt;"CURRENT"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt; won't work outside of ArcGIS Pro.&amp;nbsp; This includes scripts run from an IDE or external python interpreter or script tools/python toolbox tools started from ArcGIS Pro but&amp;nbsp;running in the background.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can use &lt;FONT face="courier new,courier"&gt;arcpy.mp&lt;/FONT&gt; outside of ArcGIS Pro, but to instantiate an &lt;FONT face="courier new,courier"&gt;ArcGISProject&lt;/FONT&gt; object, you need to use&amp;nbsp;&lt;FONT face="courier new,courier"&gt;arcpy.mp.ArcGISProject(r&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class=""&gt;"Drive:\Path\to\project.aprx&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&amp;nbsp;and understand that any changes you make won't be reflected in an open ArcGIS Pro project, but you need to save the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ArcGISProject&lt;/FONT&gt; object and then open it in Pro to see changes.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 01:04:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/does-arcpy-mp-module-work-inside-a-python-toolbox/m-p/1289909#M69256</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2023-05-17T01:04:58Z</dc:date>
    </item>
  </channel>
</rss>

