How to make change to layer in ArcMap with python/ArcObjects?

المشرف العام

Administrator
طاقم الإدارة
In ArcMap 10.1 from the python window I am attempting to rotate a symbol for a point. After I run my code I can look at the symbol properties and the rotation expression is set on the symbol, however the symbol in the data frame is not rotated.



What am I missing to get the points in the data frame to show the point rotated?

(also worth noting, if I click on "OK" in the expression builder and rotate windows, then click "apply" in the layer properties window, then "OK" the symbols are then displayed in the data frame properly)

import snippets101 as snippetssnippets.GetStandaloneModules()snippets.GetDesktopModules()import comtypes.gen.esriCarto as esriCartoimport comtypes.gen.esriFramework as esriFrameworkimport comtypes.gen.esriArcMapUI as esriArcMapUIimport comtypes.gen.stdole as stdoleimport comtypes.gen.esriDisplay as esriDisplayfrom snippets101 import CTypefrom snippets101 import NewObjpApp = snippets.GetCurrentApp()pMxDoc = CType(pApp.Document, esriArcMapUI.IMxDocument)pMap = pMxDoc.FocusMappAV = CType(pMap, esriCarto.IActiveView)pFeatureLayer = CType(pMxDoc.FocusMap.Layer(0), esriCarto.IFeatureLayer)pGeoFeatureLayer = CType(pFeatureLayer, esriCarto.IGeoFeatureLayer)pRotationRenderer = CType(pGeoFeatureLayer.Renderer,esriCarto.IRotationRenderer2)pRotationRenderer.SetSymbolRotation3DFlags = (4)pRotationRenderer.SetSymbolRotation3DExpressions('','','[SDO_ORIENTATION] * -1')pRotationRenderer.SymbolRotation3DRotationTypeZ = 0pAV.refresh()

أكثر...
 
أعلى