SketchEditor rotation does not allow to set rotation axis point

190
0
01-12-2022 05:07 AM
jcarlos
New Contributor

I'm using SketchEditor.StartAsync()  to rotate an existing graphic geometry. However, I have a problem because the rotation center changes every time that I rotate the figure. There is any way to select or set the axis of rotation? Or how could I rotate it correctly?

I'm using ArcGISRuntime 100.12.0 in a WPF application with .net framework.

I attach some screenshots of the problem.

I want to rotate this figure:  

 
 

GetImage.png

I rotate it a couple of times:  

jcarlos_1-1641981476553.png

 

When I try to return to the origin position, the shape does not match because, in every previous rotation, the axis to the rotation was different.

jcarlos_2-1641981476557.png

My code:

 

 

try 
            { 
                AssociatedObject.SketchEditor = new SketchEditor 
                { 
                    IsEnabled = true 
                }; 
                SketchEditConfiguration sketchConfig = new SketchEditConfiguration() 
            { 
                AllowRotate = true, 
                AllowVertexEditing = false, 
                AllowMove = false, 
                ResizeMode = SketchResizeMode.None, 
                VertexEditMode = SketchVertexEditMode.InteractionEdit, 
                RequireSelectionBeforeDrag = false 
            }; 
                SketchCreationMode creationMode = SketchCreationMode.Polygon; 
                SketchEditorGeometry = await AssociatedObject.SketchEditor.StartAsync(g.Geometry, creationMode, sketchConfig); 
                if (SketchEditorGeometry == null) 
                { 
                    CancelCurrentActions(); 
                } 
                else 
                { 
                    // change old geometry.
                } 
            } 
            catch (Exception ex) 
            { 
// … 
} 

 

 

 

0 Kudos
0 Replies