Select to view content in your preferred language

Getting X Y Point from contxt menu right click

715
3
Jump to solution
08-19-2013 01:44 PM
MichaelGiron
New Contributor
Hello,

I have created a custom tool that I've added to the Sketch Tool context menu. How do get the x y point on the map that was clicked to fire the context menu?

Thanks!
0 Kudos
1 Solution

Accepted Solutions
JeffMatson
Frequent Contributor
Hello,

I have created a custom tool that I've added to the Sketch Tool context menu. How do get the x y point on the map that was clicked to fire the context menu?

Thanks!



You can override the IDocumentEvents_OnContextMenu event, and convert the screen coordinates to map coordinates using IActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint

View solution in original post

0 Kudos
3 Replies
JeffMatson
Frequent Contributor
Hello,

I have created a custom tool that I've added to the Sketch Tool context menu. How do get the x y point on the map that was clicked to fire the context menu?

Thanks!



You can override the IDocumentEvents_OnContextMenu event, and convert the screen coordinates to map coordinates using IActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint
0 Kudos
MichaelGiron
New Contributor
You can override the IDocumentEvents_OnContextMenu event, and convert the screen coordinates to map coordinates using IActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint


That did the trick. Thanks!!
0 Kudos
by Anonymous User
Not applicable
You can also use IEditor.Location to avoid document events.
0 Kudos