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.
Solved! Go to Solution.
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?
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?
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