ArcScene ToMapPoint

239
1
11-07-2011 12:47 PM
LeonGosslin
New Contributor
Using VBA, I am trying to mouse click in ArcScene and get the geographic coordinates of where the mouse was clicked.  This is easy in ArcMap using the MouseDown event:

Set pPoint = pMxApp.Display.DisplayTransformation.ToMapPoint(x, y)

Is there an equivalent in ArcScene?  It is easy to get the screen x,y in ArcScene using the MouseDown event, but I can't seem to figure out how to convert them to geographic coordinates.  I have been messing around with ISceneGraph.Locate, but it doesn't seem to work, or I am doing something wrong.

Any ideas?

Thanks.
0 Kudos
1 Reply
NuriyaKunakkuzhina
New Contributor
Hi, in ArcScene you can use scenegraph.Locate to convert you mouse coordinates to map coordinates, but for my situation  it works only for existing features in Scene. I make add-in tool that create point by clicking mouse, and if i click on empty space of scene it return error like "the operation attempted on empty geometry", if i click any geometry objects (put my point on polygon or line) it works properly...


ISceneGraph pSG = scene.SceneGraph;
esriScenePickMode nMode = new esriScenePickMode();
object pOwner = new object();
object pObject = new object();
pSG.Locate(pViewer, X, Y, nMode, true, out pPntReturn, out pOwner, out pObject);
0 Kudos