Inserting CIMRowTemplate into SubTypeLayer does not work

397
1
Jump to solution
10-31-2023 05:54 AM
marco_vertigis
New Contributor III

Hi there,

I got a custom script which does create some CIMRowTemplates and tries to insert these into a CIMMapDefinition more specifically into a SubTypeLayer. Unfortunately the self generated CIMRowTemplate always seems to dissapear as soon as I import the .mapx file into ArcGIS Pro.

On the left side is the manipulated .mapx file and the self generated CIMRowTemplate 'tees-300er' (marked red). It seems almost identical to the default Feature Template '300er' directly above

On the right side you see the .mapx File after I imported it into ArcGIS Pro. The self created CIMRowTemplate just vanished.

difference.PNG

 

I have absolutely no problem when creating CIM templates and importing them into 'regular' layers (non subtype layers).

The CIMRowTemplate JSON just looks fine, so I got the gut feeling that there is something not right behind the scenes. I got absolutely no clue why my template does not seem to be 'valid'?

 

The code looks approx like this

 

cim_template = CIMRowTemplate()
# .. set some properties
cim_layer = layer.getDefinition("V3")
cim_layer.featureTemplates.append(cim_template)
layer.setDefinition(cim_layer)

 

 

Both .mapx files are attached. Somehow I could not upload the .mapx file type? 🙂

Any help would be appreciated!

0 Kudos
1 Solution

Accepted Solutions
marco_vertigis
New Contributor III

I just figured it out myself! I had to set the 'autoGenerateFeatureTemplates' property to False before applying the cim definition to the layer. Then it worked. Just a bit confusing that I dont have to do this for 'regular' layers and only for sub type layers.

 

layer_definition.autoGenerateFeatureTemplates = False

 

View solution in original post

0 Kudos
1 Reply
marco_vertigis
New Contributor III

I just figured it out myself! I had to set the 'autoGenerateFeatureTemplates' property to False before applying the cim definition to the layer. Then it worked. Just a bit confusing that I dont have to do this for 'regular' layers and only for sub type layers.

 

layer_definition.autoGenerateFeatureTemplates = False

 

0 Kudos