Select to view content in your preferred language

Prevent point symbols from rotating with data frame rotation

3735
2
Jump to solution
04-22-2016 01:11 PM
ZacHittie1
New Contributor

Is anyone familiar with a way to stop point features from rotating along with the data frame when it comes to ArcObjects?


I am familiar with the Advanced ArcMap Settings Utility for ArcMap where you can enable or disable "Rotate marker symbols with dataframe" checkbox on the Data Frame tab.  I'm looking for that option to disable simple marker rotation using ArcObjects and ArcGIS Engine.

I've gone into things like ISymbolRotation.RotateWithTransform Property (unsuccessfully), and IRotationRenderer & IRotationRenderer2 but these seem to apply to specific features. I figure there must be a way to disable simple marker rotation across an entire map project.

0 Kudos
1 Solution

Accepted Solutions
DavidBarnes
Deactivated User

I don't know about ArcObjects, but the advanced settings utility sets a reg key that says don't rotate. Can you do something with ArcObjects to set that?

View solution in original post

2 Replies
DavidBarnes
Deactivated User

I don't know about ArcObjects, but the advanced settings utility sets a reg key that says don't rotate. Can you do something with ArcObjects to set that?

ZacHittie1
New Contributor

David, thanks for the suggestion. I didn't think to explicitly try setting that in the registry, but that does indeed work. I was able to code it up so the app establishes this key for me before I bind to the runtime. Code might go something like this if anyone else is trying to do this.

    Private Sub rotateRegistryKey()
        Try
            Dim pRuntimeInfo As IEnumerable(Of ESRI.ArcGIS.RuntimeInfo) = ESRI.ArcGIS.RuntimeManager.InstalledRuntimes


            For Each item As ESRI.ArcGIS.RuntimeInfo In pRuntimeInfo
                Dim version As String = item.Version
                Dim productName As String = Nothing


                Select Case item.Product
                    Case Is = 1
                        productName = "Desktop"
                    Case Is = 2
                        productName = "Engine"
                End Select


                If Not productName Is Nothing Then
                    Dim appKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\ESRI\" & productName & version & "\Symbology\Settings", True)


                    If Not appKey Is Nothing Then
                        'REGISTRY KEY EXISTS - CHECK DWORD VALUE
                        Dim regString As String = appKey.GetValue("RotateWithTransform")


                        If regString Is Nothing Then
                            'DWORD DOES NOT EXIST - CREATE AND SET VALUE TO 0 TO PREVENT POINT FEATURES FROM ROTATING
                            appKey.SetValue("RotateWithTransform", 0)
                        Else
                            If regString <> 0 Then
                                'SETTING EXISTS BUT ROTATION IS CURRENTLY ENABLED. SET TO 0 TO PREVENT POINTS FROM ROTATING
                                appKey.SetValue("RotateWithTransform", 0)
                            End If
                        End If
                    End If
                End If
            Next
        Catch ex As Exception
            WriteLog("ERROR WITH ROTATION TRANSFORM KEY IN REGISTRY.")
        End Try
    End Sub