<?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: How to get current APRX in Python Toolbox? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-get-current-aprx-in-python-toolbox/m-p/1333575#M68775</link>
    <description>&lt;P&gt;That always works for me?&lt;/P&gt;&lt;P&gt;What part of the pyt is this in?&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2023 20:27:27 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2023-09-28T20:27:27Z</dc:date>
    <item>
      <title>How to get current APRX in Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-current-aprx-in-python-toolbox/m-p/1333568#M68774</link>
      <description>&lt;P&gt;What is the best way to get the current APRX in a Python Toolbox (.pyt) tool? I've found that if I use arcpy.mp.ArcGISProject("CURRENT") then the initial loading of the toolboxes will results in the error below. If I right click on the toolbox and refresh then everything works fine until the next time I close and re-open the APRX.&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;Traceback (most recent call last):
  File "&amp;lt;string&amp;gt;", line 100, in __init__
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 536, in __init__
    self._arc_object = arcgisscripting._mapping.ArcGISProject(*gp_fixargs((aprx_path,), True))
OSError: CURRENT&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 20:12:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-current-aprx-in-python-toolbox/m-p/1333568#M68774</guid>
      <dc:creator>JK10</dc:creator>
      <dc:date>2023-09-28T20:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current APRX in Python Toolbox?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-current-aprx-in-python-toolbox/m-p/1333575#M68775</link>
      <description>&lt;P&gt;That always works for me?&lt;/P&gt;&lt;P&gt;What part of the pyt is this in?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 20:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-current-aprx-in-python-toolbox/m-p/1333575#M68775</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-09-28T20:27:27Z</dc:date>
    </item>
  </channel>
</rss>

