Select to view content in your preferred language

Change width of frame outline of mil2525d symbols with dictionary script

2027
12
Jump to solution
10-30-2023 05:37 AM
imbachb
Regular Contributor

I'd like to change the width of the frame outline of certain mil2525d symbols via dictionary script. The symbol with key 0_101_0 is defined like so:

radimbachb_0-1698669332140.png

 

{
    "type": "CIMPointSymbol",
    "symbolLayers": [
        {
            "type": "CIMVectorMarker",
            "enable": true,
            "anchorPointUnits": "Relative",
            "dominantSizeAxis3D": "Z",
            "size": 64,
            "billboardMode3D": "FaceNearPlane",
            "frame": {
                "xmin": 0,
                "ymin": 0,
                "xmax": 612,
                "ymax": 792
            },
            "markerGraphics": [
                {
                    "type": "CIMMarkerGraphic",
                    "geometry": {
                        "rings": [
                            [
                                [
                                    391,
                                    278
                                ],
                                ...
                            ]
                        ],
                        "spatialReference": {
                            "wkid": null
                        }
                    },
                    "symbol": {
                        "type": "CIMPolygonSymbol",
                        "symbolLayers": [
                            {
                                "type": "CIMSolidFill",
                                "enable": true,
                                "primitiveName": "frame_fill",
                                "color": [
                                    255,
                                    255,
                                    128,
                                    255
                                ]
                            }
                        ]
                    }
                },
                {
                    "type": "CIMMarkerGraphic",
                    "geometry": {
                        "paths": [
                            [
                                [
                                    391,
                                    278
                                ],
                                ...
                            ]
                        ],
                        "spatialReference": {
                            "wkid": null
                        }
                    },
                    "symbol": {
                        "type": "CIMPolygonSymbol",
                        "symbolLayers": [
                            {
                                "type": "CIMSolidStroke",
                                "enable": true,
                                "primitiveName": "frame_outline",
                                "capStyle": "Butt",
                                "joinStyle": "Miter",
                                "lineStyle3D": "Strip",
                                "miterLimit": 10,
                                "width": 5,
                                "color": [
                                    0,
                                    0,
                                    0,
                                    255
                                ]
                            }
                        ]
                    }
                }
            ],
            "scaleSymbolsProportionally": true,
            "respectFrame": true
        }
    ],
    "haloSize": 1,
    "scaleX": 1,
    "angleAlignment": "Display"
}

 

Using the primitive name `frame_outline` I should be able to change the width of the rendered frame outline. When I change the width in this JSON then the new width is rendered. However, when I want to do this in the dictionary script using a primitive override

`keys += ';po:frame_outline|Width|100';`

The returned keys from the dictionary script looks like

`0_101_0;po:frame_fill|Color|RGBA(0,0,0,0);po:frame_outline|Color|#FF00FF;po:frame_outline|Width|100;...`

However, the width of the rendered frame outline is still the original width...

Changing the color of the frame_outline works though with following script

`keys += ';po:frame_outline|Color|#00FF00';`

This results in the correct color applied to the frame outline.

Why does it not work with the frame_outline width? Is there no way to change the width of the frame_outline via the dictionary script? 

Many thanks!

0 Kudos
12 Replies
imbachb
Regular Contributor

Hi Amir

I uploaded the source files as an attachment. If you put your `sample.stylx` file from your second Symbology.zip file into C:\Users\<USER>\ArcGIS\sample.stylx it should work.
In `main.cpp` on line 25 it tries to get the API key from an environment variable called "ArcGISApiKey". Simply replace that line with your key.

I'm using Arcgis Maps SDK for Qt, version 200.2.
Many thanks for looking into it.

0 Kudos
imbachb
Regular Contributor

Hi @Amir-Sarrafzadeh-Arasi 

I asked the question in the arcgis native maps qt sdk forum and there Esri confirmed that setting the width via arcade script is not supported yet, but will be available in the next version.

Solved: Re: Setting width of CIMSolidStroke via arcade has... - Esri Community

Thank you again for the troubleshooting.

0 Kudos
Amir-Sarrafzadeh-Arasi
Frequent Contributor

My Pleaseure,
Best of luck

 

Amir Sarrafzadeh Arasi