Select to view content in your preferred language

How to update all style items at once?

597
2
12-12-2022 07:25 PM
圈圈
by
Regular Contributor

我尝试使用SDK修改特定样式的符号属性,但是我只能一次更新一个样式符号。有没有办法在全部修改完成后一次性更新样式里的所有符号?

 

I tried using the SDK to modify the symbol properties of a particular style, but I can only update style symbols one at a time.

_0-1670901723593.png

 

                    PolygonSymbol = style.SearchSymbols(StyleItemType.PolygonSymbol, "");
                    

                    foreach (SymbolStyleItem pSymbol in PolygonSymbol)
                    {
                        var attValue1 = pSymbol.GetType().GetProperty(att1).GetValue(pSymbol, null);
                        var attValue2 = pSymbol.GetType().GetProperty(att2).GetValue(pSymbol, null);
                        
                        pSymbol.GetType().GetProperty(att1).SetValue(pSymbol, attValue2);
                        pSymbol.GetType().GetProperty(att2).SetValue(pSymbol, attValue1);

                        style.UpdateItem(pSymbol);
                    }

 

Is there a way to update all the symbols in a style once ?

0 Kudos
2 Replies
CharlesMacleod
Esri Regular Contributor

There is no "global" change/update on a style

0 Kudos
圈圈
by
Regular Contributor

This can be frustrating. It will take a lot of time if there are a lot of symbols to update.

Thank you

0 Kudos