TransWikia.com

Converting ArcMap to ArcGlobe code using ArcPy

Geographic Information Systems Asked by easyfreeze on December 27, 2020

I have a code that should read the mouse coordinates, but it only works in ArcMap, can I somehow translate it into code for ArcGlobe, otherwise it gives an error: CreateObject cannot open map document.

def onMouseDownMap(self, x, y, button, shift):
        mxd = arcpy.mapping.MapDocument("CURRENT")
        df = mxd.activeDataFrame
        sr = df.spatialReference
        point = arcpy.Point(X=x, Y=y)
        pointGeometry = arcpy.PointGeometry(point,sr).projecntAs(arcpy.SpatialReference(4326))
        X=pointGeometry.firstPoint.X
        Y=pointGeometry.firstPoint.Y
        pythonaddins.MessageBox("Your mouse clicked at " + str(X) + " , " + str(Y),"My Coordinates:")

One Answer

The arcpy.mapping module allows you to create a MapDocument object.

However, neither it or any other arcpy module will allow you to create the "GlobeDocument" that you seem to be seeking.

I think you may be better exploring ArcGIS Pro for 3D work like this.

Answered by PolyGeo on December 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP