<?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: Arcpy passed map parameter not working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036059#M60373</link>
    <description>&lt;P&gt;To be clear, the parameter data type in the tool properties is "Map"&lt;/P&gt;&lt;P&gt;When I just say "&lt;SPAN&gt;arcpy.AddMessage(map1)" there are no errors and the message is the name of the map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I try "arcpy.AddMessage(type(map1)) is says "&amp;lt;class 'geoprocessing value object'&amp;gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Mar 2021 18:20:35 GMT</pubDate>
    <dc:creator>B_Brooks</dc:creator>
    <dc:date>2021-03-12T18:20:35Z</dc:date>
    <item>
      <title>Arcpy passed map parameter not working</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036057#M60372</link>
      <description>&lt;P&gt;Hello, I'm having some struggles with my script. In my model, I set the first parameter to be the map to convert.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;arcpy&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;map1&amp;nbsp;=&amp;nbsp;arcpy.GetParameter(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.AddMessage(map1.name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And I get the error:&amp;nbsp;AttributeError: ValueObject: Get attribute name does not exist&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The documentation for the map class says that "name" is a property, so why isn't it working?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;~Brandon&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Mar 2021 18:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036057#M60372</guid>
      <dc:creator>B_Brooks</dc:creator>
      <dc:date>2021-03-12T18:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy passed map parameter not working</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036059#M60373</link>
      <description>&lt;P&gt;To be clear, the parameter data type in the tool properties is "Map"&lt;/P&gt;&lt;P&gt;When I just say "&lt;SPAN&gt;arcpy.AddMessage(map1)" there are no errors and the message is the name of the map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I try "arcpy.AddMessage(type(map1)) is says "&amp;lt;class 'geoprocessing value object'&amp;gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 18:20:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036059#M60373</guid>
      <dc:creator>B_Brooks</dc:creator>
      <dc:date>2021-03-12T18:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy passed map parameter not working</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036075#M60374</link>
      <description>&lt;P&gt;So I have figured out that the map class in the arcpy mapping module is not the same as the map data type, but that's as far as I've been able to get with the documentation. Confirmation that my approach is wrong, but so far no idea on next steps.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 18:56:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036075#M60374</guid>
      <dc:creator>B_Brooks</dc:creator>
      <dc:date>2021-03-12T18:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy passed map parameter not working</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036097#M60377</link>
      <description>&lt;P&gt;Here is the solution:&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;mapName = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;map1 = aprx.listMaps(mapName)[0]&lt;/P&gt;&lt;P&gt;arcpy.AddMessage(map1.name)&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 19:37:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-passed-map-parameter-not-working/m-p/1036097#M60377</guid>
      <dc:creator>B_Brooks</dc:creator>
      <dc:date>2021-03-12T19:37:18Z</dc:date>
    </item>
  </channel>
</rss>

