Mouse event on CIMgraphic

357
2
Jump to solution
09-28-2022 11:36 AM
AndrewAlexander1
New Contributor II

Hello, a while back I asked a dumb question about moving a graphic, once created programmatically.  I'm very new to ArcGIS.

So now that I know how to move it, I'd like to know how to get the event when the mouse stops moving the graphic, so that I can get the new location of the graphic.

I see in the properties for the graphic, it shows the new location, but I need to get that programmatically after they move it.

 

Thanks

Andy

 

0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

I assume u mean the graphics added to a layout or graphics layer?

At Pro 3.0+ use:

ArcGIS.Desktop.Layouts.Events.ElementEvent 

ArcGIS.Desktop.Layouts.Events.ElementEventArgs.Hint of ElementEventHint.PlacementChanged

so, something like:

ArcGIS.Desktop.Layouts.Events.ElementEvent.Subscribe((args) => {
 var elems = args.Container.GetSelectedElements();
 switch (args.Hint){
    ...
    case ElementEventHint.PlacementChanged:
      //TODO - handle element move if the elements are 
      //graphic elements

View solution in original post

0 Kudos
2 Replies
CharlesMacleod
Esri Regular Contributor

I assume u mean the graphics added to a layout or graphics layer?

At Pro 3.0+ use:

ArcGIS.Desktop.Layouts.Events.ElementEvent 

ArcGIS.Desktop.Layouts.Events.ElementEventArgs.Hint of ElementEventHint.PlacementChanged

so, something like:

ArcGIS.Desktop.Layouts.Events.ElementEvent.Subscribe((args) => {
 var elems = args.Container.GetSelectedElements();
 switch (args.Hint){
    ...
    case ElementEventHint.PlacementChanged:
      //TODO - handle element move if the elements are 
      //graphic elements
0 Kudos
AndrewAlexander1
New Contributor II

Yes, thank you very much.

Andy

 

0 Kudos