Use Get Symbol From JSON with a CIM symbol
Does anyone have an example that shows how to get a symbol from a CIM symbol definition in JSON? When I try to load a JSON generated in the Symbol Builder , Get Symbol From JSON returns a symbol with type="cim"; color=[0,0,0] and data=null. All other properties from the JSON seem to be ignored.
All other types of symbol, e.g. a SimpleLineSymbol work fine.
Here's an example JSON
{
"type": "CIMLineSymbol",
"symbolLayers": [
{
"type": "CIMVectorMarker",
"enable": true,
"anchorPointUnits": "Relative",
"dominantSizeAxis3D": "Y",
"size": 7,
"billboardMode3D": "FaceNearPlane",
"markerPlacement": {
"type": "CIMMarkerPlacementOnLine",
"angleToLine": true,
"relativeTo": "LineMiddle"
},
"frame": {
"xmin": -5,
"ymin": -5,
"xmax": 5,
"ymax": 5
},
"markerGraphics": [
{
"type": "CIMMarkerGraphic",
"geometry": {
"rings": [
[
[0,5],
[0.87,4.92],
[1.71,4.7],
[2.5,4.33],
[3.21,3.83],
[3.83,3.21],
[4.33,2.5],
[4.7,1.71],
[4.92,0.87],
[5,0],
[4.92,-0.87],
[4.7,-1.71],
[4.33,-2.5],
[3.83,-3.21],
[3.21,-3.83],
[2.5,-4.33],
[1.71,-4.7],
[0.87,-4.92],
[0,-5],
[-0.87,-4.92],
[-1.71,-4.7],
[-2.5,-4.33],
[-3.21,-3.83],
[-3.83,-3.21],
[-4.33,-2.5],
[-4.7,-1.71],
[-4.92,-0.87],
[-5,0],
[-4.92,0.87],
[-4.7,1.71],
[-4.33,2.5],
[-3.83,3.21],
[-3.21,3.83],
[-2.5,4.33],
[-1.71,4.7],
[-0.87,4.92],
[0,5]
]
]
},
"symbol": {
"type": "CIMPolygonSymbol",
"symbolLayers": [
{
"type": "CIMSolidFill",
"enable": true,
"color": [0,0,0,255]
}
]
}
}
],
"scaleSymbolsProportionally": true,
"respectFrame": true
},
{
"type": "CIMVectorMarker",
"enable": true,
"anchorPoint": {
"x": 0.0004438008035129969,
"y": -0.000005729214410147658,
"z": 0
},
"anchorPointUnits": "Relative",
"dominantSizeAxis3D": "Y",
"size": 24,
"billboardMode3D": "FaceNearPlane",
"markerPlacement": {
"type": "CIMMarkerPlacementAtExtremities",
"angleToLine": true,
"extremityPlacement": "Both",
"offsetAlongLine": -6
},
"frame": {
"xmin": -295,
"ymin": -300,
"xmax": 294,
"ymax": 300
},
"markerGraphics": [
{
"type": "CIMMarkerGraphic",
"geometry": {
"rings": [
[
[142.1,93],
[-83.5,0.4],
[142.1,-93],
[142.1,-145.5],
[-142.4,-23.9],
[-142.4,25.3],
[142.1,145.5],
[142.1,93]
]
]
},
"symbol": {
"type": "CIMPolygonSymbol",
"symbolLayers": [
{
"type": "CIMSolidStroke",
"enable": true,
"capStyle": "Round",
"joinStyle": "Round",
"lineStyle3D": "Strip",
"miterLimit": 10,
"width": 0,
"color": [0,0,0,255]
},
{
"type": "CIMSolidFill",
"enable": true,
"color": [0,0,0,255]
}
]
}
}
],
"scaleSymbolsProportionally": true,
"respectFrame": true
},
{
"type": "CIMSolidStroke",
"enable": true,
"capStyle": "Square",
"joinStyle": "Round",
"lineStyle3D": "Strip",
"miterLimit": 10,
"width": 2,
"color": [0,0,0,255]
}
],
"animations": []
}
-
Hi I can 100% replicate what you came across with some other CIM json. Made attempts but never make it work in Web.
It's first mentioned in workflow What's New last year:
5.42 - 12 November 2024
▪238671: Added support for CIMSymbol in Get Symbol From JSON activity.0 -
Yeah, I got a reply from support:
Support for CIM Symbol display will be included in the next release of VSW 5.37
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires