<?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 How to access element in geoprocessing value object? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488522#M38161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all&lt;/P&gt;&lt;P&gt;I am puzzled by a simple problem.&amp;nbsp; I don't know how to access a point&amp;nbsp;object's x and y coordinate&amp;nbsp;from a &amp;nbsp;arctoolbox in&amp;nbsp; python script.&lt;/P&gt;&lt;P&gt;It can be accessed&amp;nbsp; this way:&lt;/P&gt;&lt;P&gt;pnt=arcpy.GetParameterAsText(0).split()&amp;nbsp;&amp;nbsp;&amp;nbsp; # c1 is a point object in arctoolbox interface&lt;BR /&gt;x=float(pnt[0])&lt;BR /&gt;y=float(pnt[1])&lt;/P&gt;&lt;P&gt;It's not ideal because the code will fail when the x and y are inputed in different decimal seperator, say ',' format.&lt;/P&gt;&lt;P&gt;So I use:&lt;/P&gt;&lt;P&gt;pnt=arcpy.GetParamete(0)&lt;/P&gt;&lt;P&gt;But what's the method to get pnt.X and pnt.Y?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jan 2017 04:30:16 GMT</pubDate>
    <dc:creator>TieshengWu</dc:creator>
    <dc:date>2017-01-24T04:30:16Z</dc:date>
    <item>
      <title>How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488522#M38161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all&lt;/P&gt;&lt;P&gt;I am puzzled by a simple problem.&amp;nbsp; I don't know how to access a point&amp;nbsp;object's x and y coordinate&amp;nbsp;from a &amp;nbsp;arctoolbox in&amp;nbsp; python script.&lt;/P&gt;&lt;P&gt;It can be accessed&amp;nbsp; this way:&lt;/P&gt;&lt;P&gt;pnt=arcpy.GetParameterAsText(0).split()&amp;nbsp;&amp;nbsp;&amp;nbsp; # c1 is a point object in arctoolbox interface&lt;BR /&gt;x=float(pnt[0])&lt;BR /&gt;y=float(pnt[1])&lt;/P&gt;&lt;P&gt;It's not ideal because the code will fail when the x and y are inputed in different decimal seperator, say ',' format.&lt;/P&gt;&lt;P&gt;So I use:&lt;/P&gt;&lt;P&gt;pnt=arcpy.GetParamete(0)&lt;/P&gt;&lt;P&gt;But what's the method to get pnt.X and pnt.Y?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 04:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488522#M38161</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2017-01-24T04:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488523#M38162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at this help description:&amp;nbsp;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/classes/point.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://pro.arcgis.com/en/pro-app/arcpy/classes/point.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then to read the geometry:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;point &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
ptGeometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PointGeometry&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ptGeometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X
y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ptGeometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:29:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488523#M38162</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2021-12-11T21:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488524#M38163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Basson. Line 2 return: RuntimeError: Object: CreateObject cannot create geometry from inputs.&lt;/P&gt;&lt;P&gt;arcpy.AddMessage(type(point))&amp;nbsp;show:&amp;nbsp; &amp;lt;type 'geoprocessing value object'&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 09:58:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488524#M38163</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2017-01-24T09:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488525#M38164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It leaves the question of how your point object is defined? &amp;nbsp;Is it a string? &amp;nbsp;Please provide more information on the tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 10:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488525#M38164</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2017-01-24T10:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488526#M38165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/307891_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 10:04:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488526#M38165</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2017-01-24T10:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488527#M38166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;point &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
coords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; coords&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; coords&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;y&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:29:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488527#M38166</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2021-12-11T21:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488528#M38167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The x and y will be&amp;nbsp;used as float, so decimal seperator problem still exists.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 10:49:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488528#M38167</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2017-01-24T10:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488529#M38168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your decimals should be in point notation (12.3456) and not comma notation (12,3456), then the Python code works. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 11:13:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488529#M38168</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2017-01-24T11:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488530#M38169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Than you Basson, but I am tring to write a tool not only for myself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 11:52:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488530#M38169</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2017-01-24T11:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to access element in geoprocessing value object?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488531#M38170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So your issue is with the regional settings of the OS for decimal number notation. &amp;nbsp;You can detect what format the user's OS is showing floats with&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;locale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;localeconv&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'decimal_point'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 12:08:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-element-in-geoprocessing-value/m-p/488531#M38170</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2017-01-24T12:08:27Z</dc:date>
    </item>
  </channel>
</rss>

