Hi, I'm trying to extract information about Scales and line width at these scales using Python (Notebooks). I tried to use CIM, but I hadn't accessed "scaleDependentSizeVariation" from lyr. I can see this information in JSON (.lyr) file, but I don't know how to extract this information.
"scaleDependentSizeVariation" : [
{
"type" : "CIMScaleDependentSizeVariation",
"scale" : 1000000000,
"size" : 1.7291338582677165
},
{
"type" : "CIMScaleDependentSizeVariation",
"scale" : 120944,
"size" : 2
},
{
"type" : "CIMScaleDependentSizeVariation",
"scale" : 60472,
"size" : 2.5
},
{
"type" : "CIMScaleDependentSizeVariation",
"scale" : 30236,
"size" : 2.9763999999999999
},
{
"type" : "CIMScaleDependentSizeVariation",
"scale" : 25000,
"size" : 2.5
},
{
"type" : "CIMScaleDependentSizeVariation",
"scale" : 15118,
"size" : 3.5
}
]
},
Could you just read the .lyr file with JSON loads and then grab it from there, or do you have to go through other means?
variable = json.loads(r'path to .lyr')
for dct in variable['scaleDependentSizeVariation']:
for k, v in dct.items():
print(f'k: {k} v: {v}')