<?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: Can I add Z value from a window, after got XY from mouse click in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58858#M4623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After you get your point you might be able to run &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/extract-values-to-points.htm"&gt;extract values to points​&lt;/A&gt; or &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/extract-multi-values-to-points.htm"&gt;extract multi values to points&lt;/A&gt;​ or &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/add-surface-information.htm"&gt;Add Surface Information&lt;/A&gt;. Then you could either run a quick &lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/data-access/updatecursor-class.htm"&gt;update cursor&lt;/A&gt;​ or&amp;nbsp; &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/feature-to-3d-by-attribute.htm"&gt;Feature To 3D By Attribute&lt;/A&gt;​ to insert the Z value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jan 2016 12:14:11 GMT</pubDate>
    <dc:creator>LukeSturtevant</dc:creator>
    <dc:date>2016-01-05T12:14:11Z</dc:date>
    <item>
      <title>Can I add Z value from a window, after got XY from mouse click</title>
      <link>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58857#M4622</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;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I would like to create a point shape with Z value in ArcMap, for that I&lt;/SPAN&gt; was created a tool using &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;python addin toolbar&lt;/SPAN&gt;. The tool can get XY coordinates from mouse click on datafreme. Now I want to add Z value as manuel for this point. Can I add Z value from a window by created QWidget or other PyQt4 windows, after got the XY position on dataframe for my point shape. &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Is there any way to do this using python? &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Can you kindly give any advices?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current code:&lt;/P&gt;&lt;P&gt;There is global z in my code, it is just a simple solution and I dont want to use it. You know it isn't useful way. &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import pythonaddins
arcpy.env.overwriteOutput = True
arcpy.env.addOutputsToMap = True
arcpy.CheckExtension('3D')


class Observation_Point(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Implementation for addin5_addin.tool (Tool)"""
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.enabled = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.shape = "NONE"
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onMouseDown(self, x, y, button, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onMouseDownMap(self, x, y, button, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #choose XY on dataframe
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("current")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataframe = arcpy.mapping.ListDataFrames(mxd)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; global z
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z= 20
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PointGeom = arcpy.PointGeometry(arcpy.Point(x,y,z), None, True, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; global A
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = "C:\\Users\\Casper\\Desktop\\DENEMELER\\obs_point_fromAddin5.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(PointGeom, A)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "saved as a point.shp..."
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onMouseUp(self, x, y, button, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onMouseUpMap(self, x, y, button, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onMouseMove(self, x, y, button, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onMouseMoveMap(self, x, y, button, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onDblClick(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onKeyDown(self, keycode, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onKeyUp(self, keycode, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def deactivate(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onCircle(self, circle_geometry):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onLine(self, line_geometry):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; def onRectangle(self, rectangle_geometry):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:14:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58857#M4622</guid>
      <dc:creator>SebahatT_K</dc:creator>
      <dc:date>2021-12-10T22:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can I add Z value from a window, after got XY from mouse click</title>
      <link>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58858#M4623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After you get your point you might be able to run &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/extract-values-to-points.htm"&gt;extract values to points​&lt;/A&gt; or &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/extract-multi-values-to-points.htm"&gt;extract multi values to points&lt;/A&gt;​ or &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/add-surface-information.htm"&gt;Add Surface Information&lt;/A&gt;. Then you could either run a quick &lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/data-access/updatecursor-class.htm"&gt;update cursor&lt;/A&gt;​ or&amp;nbsp; &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/feature-to-3d-by-attribute.htm"&gt;Feature To 3D By Attribute&lt;/A&gt;​ to insert the Z value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 12:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58858#M4623</guid>
      <dc:creator>LukeSturtevant</dc:creator>
      <dc:date>2016-01-05T12:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I add Z value from a window, after got XY from mouse click</title>
      <link>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58859#M4624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your reply, it can be a alternative way. But I want to add Z from a window. Maybe you know that&amp;nbsp; there is Create Line of Sight button which when you click this button opens a window in 3D Analyst Toolbar in ArcMap. I want to create like this windows and want to manually write Z value. So, unfortunately I dont know what I do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 12:52:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58859#M4624</guid>
      <dc:creator>SebahatT_K</dc:creator>
      <dc:date>2016-01-05T12:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can I add Z value from a window, after got XY from mouse click</title>
      <link>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58860#M4625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I do know about the Create Line of Sight button on the 3D Analyst toolbar, but I'm not sure how you would use python with this tool. There is a &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/construct-sight-lines.htm"&gt;Construct Sight Lines&lt;/A&gt;​ tool that you might be able to use, but it looks like the tool assumes the points have Z values already? I have not played around with that tool before. Let us know what you find out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 13:06:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58860#M4625</guid>
      <dc:creator>LukeSturtevant</dc:creator>
      <dc:date>2016-01-05T13:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I add Z value from a window, after got XY from mouse click</title>
      <link>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58861#M4626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you attempted to use raw_input?&amp;nbsp; I don't know if it'd work in this context, but give it a go!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def onMouseDownMap(self, x, y, button, shift):&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #choose XY on dataframe&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("current")&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataframe = arcpy.mapping.ListDataFrames(mxd)[0]&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; global z
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var = raw_input("Enter Z-Value: ")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z= int(var)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PointGeom = arcpy.PointGeometry(arcpy.Point(x,y,z), None, True, False)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; global A&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = "C:\\Users\\Casper\\Desktop\\DENEMELER\\obs_point_fromAddin5.shp"&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(PointGeom, A)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "saved as a point.shp..." &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-add-z-value-from-a-window-after-got-xy-from/m-p/58861#M4626</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-10T22:14:12Z</dc:date>
    </item>
  </channel>
</rss>

